1 9. TCP/IP Reference: Charles L. Hedrick, “Introduction to the Internet Protocols”, Rutgers University,

Slides:



Advertisements
Similar presentations
Networking Theory (part 2). Internet Architecture The Internet is a worldwide collection of smaller networks that share a common suite of communication.
Advertisements

Oct 21, 2004CS573: Network Protocols and Standards1 IP: Addressing, ARP, Routing Network Protocols and Standards Autumn
1 © 2003, Cisco Systems, Inc. All rights reserved. CCNA 1 v3.0 Module 11 TCP/IP Transport and Application Layers.
OSI Model.
Introduction to TCP/IP
OSI Model 7 Layers 7. Application Layer 6. Presentation Layer
Chapter Overview TCP/IP Protocols IP Addressing.
CS 356 Systems Security Spring Dr. Indrajit Ray
IST 228\Ch3\IP Addressing1 TCP/IP and DoD Model (TCP/IP Model)
Process-to-Process Delivery:
WXES2106 Network Technology Semester /2005 Chapter 4 TCP/IP CCNA1: Module 9, 10.3 and 11.
G64INC Introduction to Network Communications Ho Sooi Hock Internet Protocol.
Networking Basics TCP/IP TRANSPORT and APPLICATION LAYER Version 3.0 Cisco Regional Networking Academy.
Lecture 2 TCP/IP Protocol Suite Reference: TCP/IP Protocol Suite, 4 th Edition (chapter 2) 1.
What is a Protocol A set of definitions and rules defining the method by which data is transferred between two or more entities or systems. The key elements.
© 2007 Cisco Systems, Inc. All rights reserved.Cisco Public ITE PC v4.0 Chapter 1 1 Network Services Networking for Home and Small Businesses – Chapter.
CIM 2465 Intro to TCP/IP1 Introduction to TCP/IP (Topic 5) Textbook: Networking Basics, CCNA 1 Companion Guide, Cisco Press Cisco Networking Academy Program,
TCP/IP Yang Wang Professor: M.ANVARI.
COMT 429 The Internet Protocols COMT 429. History 1969First version of a 4 node store and forward network, the ARPAnet 1972Formal demonstration of ARPAnet.
Huda AL_Omairl - Network 71 Protocols and Network Software.
Examining TCP/IP.
TCP/IP Essentials A Lab-Based Approach Shivendra Panwar, Shiwen Mao Jeong-dong Ryoo, and Yihan Li Chapter 5 UDP and Its Applications.
70-293: MCSE Guide to Planning a Microsoft Windows Server 2003 Network, Enhanced Chapter 2: TCP/IP Architecture.
Chapter Three Network Protocols By JD McGuire ARP Address Resolution Protocol Address Resolution Protocol The core protocol in the TCP/IP suite that.
Chap 9 TCP/IP Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology
10/13/2015© 2008 Raymond P. Jefferis IIILect 07 1 Internet Protocol.
University of the Western Cape Chapter 12: The Transport Layer.
TCP/IP TCP/IP LAYERED PROTOCOL TCP/IP'S APPLICATION LAYER TRANSPORT LAYER NETWORK LAYER NETWORK ACCESS LAYER (DATA LINK LAYER)
TCP/IP Transport and Application (Topic 6)
Lecture 3 Overview. Protocol An agreed upon convention for communication both endpoints need to understand the protocol. Protocols must be formally defined.
CCNA 1 v3.0 Module 11 TCP/IP Transport and Application Layers.
Internetworking Internet: A network among networks, or a network of networks Allows accommodation of multiple network technologies Universal Service Routers.
Internetworking Internet: A network among networks, or a network of networks Allows accommodation of multiple network technologies Universal Service Routers.
TCP/IP Honolulu Community College Cisco Academy Training Center Semester 2 Version 2.1.
Network Protocols n ISO OSI 7-layer model n TCP/IP suite l TCP/UDP l IP l Ethernet/Token Ring l ICMP.
CSE 6590 Department of Computer Science & Engineering York University 111/9/ :26 AM.
1 Chapter 8 – TCP/IP Fundamentals TCP/IP Protocols IP Addressing.
Networking Basics CCNA 1 Chapter 11.
Lecture 4 Overview. Ethernet Data Link Layer protocol Ethernet (IEEE 802.3) is widely used Supported by a variety of physical layer implementations Multi-access.
S305 – Network Infrastructure Chapter 5 Network and Transport Layers.
1 Bus topology network. 2 Data is sent to all computers, but only the destination computer accepts 02608c
Linux Operations and Administration Chapter Eight Network Communications.
1 Kyung Hee University Chapter 11 User Datagram Protocol.
Babu Ram Dawadi.  TCP/IP is a set of protocols developed to allow cooperating computers to share resources across a network.  TCP stands for “Transmission.
McGraw-Hill Chapter 23 Process-to-Process Delivery: UDP, TCP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
TCP/IP1 Address Resolution Protocol Internet uses IP address to recognize a computer. But IP address needs to be translated to physical address (NIC).
TCP/IP PROTOCOL UNIT 6. Overview of TCP/IP Application FTP, Telnet, SMTP, HTTP.. Presentation Session TransportHost-to-HostTCP, UDP NetworkInternetIP,
Lecture 4 : Network Architectures (cont..) 1. 2 Summary of OSI Layers.
Chapter 5 Network and Transport Layers
Chapter 11 User Datagram Protocol
IP: Addressing, ARP, Routing
Functions of Presentation Layer
Chapter 5 Network and Transport Layers
Scaling the Network: The Internet Protocol
Layered Architectures
TCP/IP Transmission Control Protocol / Internet Protocol
Networking for Home and Small Businesses – Chapter 6
Networking for Home and Small Businesses – Chapter 6
Process-to-Process Delivery:
TCP/IP Protocol Suite: Review
Networking Theory (part 2)
1 TRANSMISSION CONTROL PROTOCOL / INTERNET PROTOCOL (TCP/IP) K. PALANIVEL Systems Analyst, Computer Centre Pondicherry University, Puducherry –
Scaling the Network: The Internet Protocol
Networking for Home and Small Businesses – Chapter 6
OSI Reference Model Unit II
Process-to-Process Delivery: UDP, TCP
OSI Model 7 Layers 7. Application Layer 6. Presentation Layer
Networking Theory (part 2)
Networking Theory (part 2)
Unit – III Network Essentials
Presentation transcript:

1 9. TCP/IP Reference: Charles L. Hedrick, “Introduction to the Internet Protocols”, Rutgers University, FTP, SMTP, Telnet, HTTP,… TCP, UDP IP, ARP, ICMP Network Interface ENG224 INFORMATION TECHNOLOGY – Part I 9. TCP/IP

2 A. What is TCP/IP? TCP/IP is a set of protocols developed to allow cooperating computers to share resources across a network TCP stands for “Transmission Control Protocol” IP stands for “Internet Protocol” They are Transport layer and Network layer protocols respectively of the protocol suite The most well known network that adopted TCP/IP is Internet – the biggest WAN in the world ENG224 INFORMATION TECHNOLOGY – Part I 9. TCP/IP

3 A protocol is a collection of rules and procedures for two computers to exchange information Protocol also defines the format of data that is being exchanged What is a protocol? ENG224 INFORMATION TECHNOLOGY – Part I 9. TCP/IP

4 Why TCP/IP is so popular? TCP/IP was developed very early Technologies were widely discussed and circulated in documents called “Request for Comments” (RFC) – free of charge Supported by UNIX operating system ENG224 INFORMATION TECHNOLOGY – Part I 9. TCP/IP

5 TCP/IP Model Because TCP/IP was developed earlier than the OSI 7-layer mode, it does not have 7 layers but only 4 layers OSI 7-layerTCP/IP Protocol Suite FTP, SMTP, Telnet, HTTP,… TCP, UDP IP, ARP, ICMP Network Interface ENG224 INFORMATION TECHNOLOGY – Part I 9. TCP/IP

6 Application layer protocols define the rules when implementing specific network applications Rely on the underlying layers to provide accurate and efficient data delivery Typical protocols: FTP – File Transfer Protocol For file transfer Telnet – Remote terminal protocol For remote login on any other computer on the network SMTP – Simple Mail Transfer Protocol For mail transfer HTTP – Hypertext Transfer Protocol For Web browsing ENG224 INFORMATION TECHNOLOGY – Part I 9. TCP/IP

7 TCP/IP is built on “connectionless” technology, each datagram finds its own way to its destination Transport Layer protocols define the rules of Dividing a chunk of data into segments Reassemble segments into the original chunk Typical protocols: TCP – Transmission Control Protocol Provide further the functions such as reordering and data resend UDP – User Datagram Service Use when the message to be sent fit exactly into a datagram Use also when a more simplified data format is required ENG224 INFORMATION TECHNOLOGY – Part I 9. TCP/IP

8 Network layer protocols define the rules of how to find the routes for a packet to the destination It only gives best effort delivery. Packets can be delayed, corrupted, lost, duplicated, out-of-order Typical protocols: IP – Internet Protocol Provide packet delivery ARP – Address Resolution Protocol Define the procedures of network address / MAC address translation ICMP – Internet Control Message Protocol Define the procedures of error message transfer ENG224 INFORMATION TECHNOLOGY – Part I 9. TCP/IP

9 Application Layer Application Transport Network Network Interface ENG224 INFORMATION TECHNOLOGY – Part I 9. TCP/IP

10 SMTP TCP IP, ARP, ICMP Network Interface SMTP TCP IP, ARP, ICMP Network Interface SMTP Server Client Actual Virtual B. Example: SMTP ENG224 INFORMATION TECHNOLOGY – Part I 9. TCP/IP

11 The underlying layers have guaranteed accurate data delivery We need to make a lot agreements with the server in application layer before sending mail 1.Agree on how data is represented Binary or ASCII 2.Ensure the right recipient There may be 1000 users served by the server 3.Ensure the client has the right to send mail Some clients are not welcome 4.How to tell the server it is the end of the message All mail looks the same : ENG224 INFORMATION TECHNOLOGY – Part I 9. TCP/IP

12 Example: SMTP The following mail is to be sent: Date: Fri, 18 Jan 02 13:26:31 EDT From: To: Subject: meeting Let’s get together Monday at 1pm. ENG224 INFORMATION TECHNOLOGY – Part I 9. TCP/IP

13 SMTP Server Client access port 25 of server HELO polyu.edu.hk MAIL From: 220 eee.hku.hk SMTP Service at 20 Jan 02 05:17:18 EDT 250 eee.hku.hk – Hello, polyu.edu.hk 250 MAIL accepted ENG224 INFORMATION TECHNOLOGY – Part I 9. TCP/IP

14 Client SMTP Server Date: Fri, 18 Jan 02 13:26:31 EDT From: To: Subject: meeting Let’s get together Monday at 1pm.. RCPT To: DATA 250 Recipient accepted 354 Start mail input; end with. ENG224 INFORMATION TECHNOLOGY – Part I 9. TCP/IP

15 The agreement made in the SMTP protocol All messages use normal text All ASCII characters The responses all begin with numbers To indicate the status when receiving the command Some words are reserved words HELO, MAIL, RCPT… Mail ends with a line that contains only a period The information passed with the SMTP messages The recipient name The sender name The mail ENG224 INFORMATION TECHNOLOGY – Part I 9. TCP/IP

16 C. Domain Name (mentioned before) Every computer has a network address e.g To access a computer, we need to specify its network address Human beings are weak in memorizing numbers We prefer computer name or domain name e.g. hkpu10.polyu.edu.hk Need a machine on the Internet to convert name to number ENG224 INFORMATION TECHNOLOGY – Part I 9. TCP/IP

17 Domain name hierarchy Example: hkpu10.polyu.edu.hk Root domain name other examples: com – commercial company org – general organization net – major network centre gov – government org. mil – militrary group edu – education org. The domain within hk Note: edu.hk is not the same as edu The domain within edu.hk One of the educational institutions in H.K. Computer name ENG224 INFORMATION TECHNOLOGY – Part I 9. TCP/IP

18 An organization needs to register its domain name e.g. PolyU has registered its name to the domain of edu.hk Once a domain name is assigned, the organization is free to assign other names belong to its domain e.g. we can have hkpu10.polyu.edu.hk smtp.polyu.edu.hk mail.polyu.edu.hk ENG224 INFORMATION TECHNOLOGY – Part I 9. TCP/IP

19 Client Domain Name Server (DNS) of polyu.edu.hk Address of Where is usually UDP DNS of com DNS of Yahoo.com Where is Address of Where is yahoo.com? Address of the DNS of Yahoo.com Become client ENG224 INFORMATION TECHNOLOGY – Part I 9. TCP/IP

20 Nevertheless, such a complicated procedure needs not perform in most cases Client computers usually remember the answers that it got before It reduces the loading to the root DNS To further reduce loading, there can be many root DNS on the Internet e.g. there are a few “com” root DNS ENG224 INFORMATION TECHNOLOGY – Part I 9. TCP/IP

21 Transport Layer Application Transport Network Network Interface Message Segments hMhMhM ENG224 INFORMATION TECHNOLOGY – Part I 9. TCP/IP

22 D. TCP and UDP TCP is a connection-oriented protocol Does not mean it has a physical connection between sender and receiver TCP provides the function to allow a connection virtually exists – also called virtual circuit TCP provides the functions: Dividing a chunk of data into segments Reassembly segments into the original chunk Provide further the functions such as reordering and data resend Offering a reliable byte-stream delivery service TCP – Transmission Control Protocol ENG224 INFORMATION TECHNOLOGY – Part I 9. TCP/IP

23 Source PortDestination Port Sequence Number Acknowledgement Number Checksum Message Data TCP Dividing and Reassembly Message ENG224 INFORMATION TECHNOLOGY – Part I 9. TCP/IP

Sender Timeout retransmit A1A3 13 Recipient 2 A2 ENG224 INFORMATION TECHNOLOGY – Part I 9. TCP/IP

25 A Typical Procedure Sender TCP divides a message into segments Add sequence no. Send the segments in sequence and wait for acknowledgement If an acknowledgement for a segment is not received for a certain period of time, resend it until an acknowledgement is received Recipient When receiving segments, send the acknowledgement with correct number Reassembly the segments back to the message ENG224 INFORMATION TECHNOLOGY – Part I 9. TCP/IP

26 A computer may perform a number of network applications at the same time FTP + SMTP + HTTP, etc. Each computer has only one network address, how can it serve so many applications at the same time? Port Multiplexing  by port multiplexing Network add: Port 21 Port 25 Port 80 FTP SMTP HTTP ENG224 INFORMATION TECHNOLOGY – Part I 9. TCP/IP

27 Well-known Port Numbers Some port numbers are reserved for some purposes Port 21: FTP – file transfer Port 25: SMTP – mail transfer Port 23: TELNET – remote login Port 80: HTTP – Web access These port numbers are well known to all computers in the network E.g. whenever a client access port 25 of the server, it means the client needs SMTP service ENG224 INFORMATION TECHNOLOGY – Part I 9. TCP/IP

28 ClientSMTP Server Located by: network address + TCP port no. Source Port = 1357 Destination Port = 25 Sequence Number Acknowledgement Number Checksum Message Data SMTP port = 1357 SMTP port = 25 ENG224 INFORMATION TECHNOLOGY – Part I 9. TCP/IP

29 Client ASMTP + FTP Server Client B SMTP port = 1357 FTP port = 1361 Network address: SMTP port = 25 FTP port = 21 ENG224 INFORMATION TECHNOLOGY – Part I 9. TCP/IP

30 Network Layer Application Transport Network Network Interface Message Segments hMhMhMhMhhMhhMh Datagrams / Packets ENG224 INFORMATION TECHNOLOGY – Part I 9. TCP/IP

31 E. Network Addresses and Subnets A header is added to each segment in the Network layer IP 3 Total Length Time to Live ProtocolHeader CheckSum Source Address Destination Address Segment ENG224 INFORMATION TECHNOLOGY – Part I 9. TCP/IP

32 Total Length – Total length of a packet (up to bytes) Time to Live – How many times this packet can be routed on the network (up to 255) Protocol – The transport layer protocol that the packet belongs to TCP: 6 UDP: 17 ICMP: 1 Source address – the network address of the computer that sends the data Destination address – the network address of the computer that the data is sending to ENG224 INFORMATION TECHNOLOGY – Part I 9. TCP/IP

33 ( Already mentioned ) Each computer (host) must have a unique network address (or IP address for TCP/IP suite) Each IP address is 32-bit long (four bytes) The four-byte address is written out as a.b.c.d e.g. Byte 1Byte 2Byte 3Byte IP addresses are hierarchical network I.D. and host I.D. Each Network I.D. on the Internet needs to be registered to the Internet Assigned Number Authority ENG224 INFORMATION TECHNOLOGY – Part I 9. TCP/IP

34 Net I.D. Class A – for very large network Host I.D.0 1 bit7 bits24 bits Only 2 7 (63) networks can belong to this class Each network, there are 2 24 hosts or computers Very few class A networks in the world e.g. Arpanet – the earliest packet switched WAN (started 40 years ago) ENG224 INFORMATION TECHNOLOGY – Part I 9. TCP/IP

35 Net I.D. Class B – for medium size network Host I.D.0 2 bits14 bits16 bits 2 14 (16384) networks can belong to this class Each network, there are 2 16 (65536) hosts or computers Polyu’s address belongs to this group e.g Network I.D.Host I.D. ENG224 INFORMATION TECHNOLOGY – Part I 9. TCP/IP

36 Class C – for small network Net I.D.Host I.D.0 3 bits21 bits8 bits 2 21 networks can belong to this class Each network, there are only 2 8 (256) hosts or computers 11 ENG224 INFORMATION TECHNOLOGY – Part I 9. TCP/IP

37 Class D – for multicast network Group no.0 4 bits28 bits Packets are addressed to a multicast group Not often supported on Internet 111 ENG224 INFORMATION TECHNOLOGY – Part I 9. TCP/IP

38 Special Addresses Host I.D. = all ‘1’s  Directed broadcast “Broadcast to all hosts in the network or subnetwork”, not assigned Host I.D. = all ‘0’s  “This network”, not assigned Network I.D. = 127 is reserved for loopback and diagnostic purposes, not assigned Network I.D. + Host I.D. = all ‘1’s  Limited broadcast “Broadcast to all hosts in the current network”, not assigned ENG224 INFORMATION TECHNOLOGY – Part I 9. TCP/IP

39 Subnets A class B address can have hosts Difficult to manage Usually subdivide into a few small subnets Subnetting can also help to reduce broadcasting traffic All traffic to Total hosts Router All traffic to Each subnet 256 hosts ENG224 INFORMATION TECHNOLOGY – Part I 9. TCP/IP

40 Subnet Mask How does the router know which subnet a packet should go? For each interface of the router, a subnet mask is provided to redefine which part of the address is Net ID and which part is Host ID Become classless addressing A subnet mask: ‘1’s Net ID‘0’s Host ID ENG224 INFORMATION TECHNOLOGY – Part I 9. TCP/IP

41 Router A packet with destination address S0 E0 S1 S2 S0S1S2 Subnet Mask Routing Table AND AND Advantage: easy to compute ENG224 INFORMATION TECHNOLOGY – Part I 9. TCP/IP

42 F. Routing How a packet finds its way to a computer in a network? By using Routers Routing is the selection of a path to guide a packet from the source to the destination Criteria in selecting a path may be: Shortest path Quickest path Cheapest path ENG224 INFORMATION TECHNOLOGY – Part I 9. TCP/IP

43 Hong Kong U.S router Internet The red path is the shortest path ENG224 INFORMATION TECHNOLOGY – Part I 9. TCP/IP

44 Each router has a table that records the estimated distance to all other routers If a router knows the entire network topology, the shortest path can be calculated To achieve this, routers broadcast Link State Advertisement to all other routers periodically By means of routing protocol Each router knows the exact topology, and then calculates the shortest path In practice, it is not possible for a router to all paths. Only the nearer ones are kept Hence can give wrong estimation ENG224 INFORMATION TECHNOLOGY – Part I 9. TCP/IP

45 Host A Default gateway: Router C Host B Router C S0 T1 S1 T0 S1 T0 S0 T0 Router A Subnet Router B Routing Table Subnet S Direct T Forward Subnet Routing Table S0 S Direct ENG224 INFORMATION TECHNOLOGY – Part I 9. TCP/IP

46 1.Host A wants to send a packet to Host B with address Host A checks that is not in the same network 3.Send packet to default gateway (Router C) 4.Default gateway finds that it cannot provide the best route for the packet, inform Host A to send the packet to Router A next time 5.Router C sends the packet to Router A 6.Router A checks from the table the packet should forward to Router B 7.Router B receives the packet and checks in its table the packet should directly deliver to subnet Host B ( ) receives the packet ENG224 INFORMATION TECHNOLOGY – Part I 9. TCP/IP

47 Data Link and Physical Layers Application Transport Network Network Interface Message Segments hMhMhMhMhhMhhMh Packets hMh hMh hh Frames ENG224 INFORMATION TECHNOLOGY – Part I 9. TCP/IP

48 G. Ethernet Encapsulation and ARP An IP packet should be encapsulated into a frame for transmission by data link layer e.g. if Ethernet (or IEEE 802.3) is used: PreambleDes. AddSour. AddLengthIP PacketFCS 7 Bytes 2/6 Bytes 2/6 Bytes 2 Bytes Bytes4 Bytes 1 Byte IEEE Frame ENG224 INFORMATION TECHNOLOGY – Part I 9. TCP/IP

49 Only the hardware address (MAC address) is unique to a host Need to convert a network address to MAC address Ethernet Ethernet Frame Ethernet address = ? Packet Destination IP = Source IP = ENG224 INFORMATION TECHNOLOGY – Part I 9. TCP/IP Packet

50 ARP – Address Resolution Protocol 1. Broadcast: Who has got IP address ? What’s your Ethernet address? 2. Reply: I do. My Ethernet address is C Case 1 Ethernet Frame 3. Ethernet address = C ENG224 INFORMATION TECHNOLOGY – Part I 9. TCP/IP

51 ARP – Address Resolution Protocol Case 2 1. Broadcast: Who has got IP address ? What’s your Ethernet address? 2. Reply: The IP you indicated is not in your network. You can give the packet to me first. My MAC address is C Router 3. Ethernet Frame Ethernet address = C ENG224 INFORMATION TECHNOLOGY – Part I 9. TCP/IP

52 ARP Cache Will have a heavy traffic if so many ARP broadcast messages are generated Each host will have a cache to store the mappings (from IP to MAC address) that were obtained before An entry will only be kept in the cache for a limited amount of time (say, 2 minutes) IP AddressMAC Address C A C-1A ENG224 INFORMATION TECHNOLOGY – Part I 9. TCP/IP