TCP/IP TCP/IP architecture

Slides:



Advertisements
Similar presentations
Discussion Monday ( ). ver length 32 bits data (variable length, typically a TCP or UDP segment) 16-bit identifier header checksum time to live.
Advertisements

IPv4 - The Internet Protocol Version 4
Network Layer – IPv4 Dr. Sanjay P. Ahuja, Ph.D.
CECS 474 Computer Network Interoperability Notes for Douglas E. Comer, Computer Networks and Internets (5 th Edition) Tracy Bradley Maples, Ph.D. Computer.
Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 5-1 Internet Protocol (IP): Packet Format, Fragmentation, Options Shivkumar Kalyanaraman Rensselaer.
Week 5: Internet Protocol Continue to discuss Ethernet and ARP –MTU –Ethernet and ARP packet format IP: Internet Protocol –Datagram format –IPv4 addressing.
Winter CMPE 155 Week 8. Winter Router demos: background.
IP Suite© Dr. Ayman Abdel-Hamid, CS4254 Spring CS4254 Computer Network Architecture and Programming Dr. Ayman A. Abdel-Hamid Computer Science Department.
1 TDC TDC 365 Network Interconnections Technologies Lecture #4 Notes Spring, 2009.
The Network Layer Chapter 5. The IP Protocol The IPv4 (Internet Protocol) header.
Chapter 5 The Network Layer.
1 K. Salah Module 5.1: Internet Protocol TCP/IP Suite IP Addressing ARP RARP DHCP.
11- IP Network Layer4-1. Network Layer4-2 The Internet Network layer forwarding table Host, router network layer functions: Routing protocols path selection.
EEC-484/584 Computer Networks Lecture 11 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
Oct 21, 2004CS573: Network Protocols and Standards1 IP: Addressing, ARP, Routing Network Protocols and Standards Autumn
CS335 Networking & Network Administration Tuesday, May 11, 2010.
Introduction to TCP/IP
IP Address 0 network host 10 network host 110 networkhost 1110 multicast address A B C D class to to
Network Layer IS250 Spring 2010
IST 228\Ch3\IP Addressing1 TCP/IP and DoD Model (TCP/IP Model)
TELE202 Lecture 10 Internet Protocols (2) 1 Lecturer Dr Z. Huang Overview ¥Last Lecture »Internet Protocols (1) »Source: chapter 15 ¥This Lecture »Internet.
Petrozavodsk State University, Alex Moschevikin, 2003NET TECHNOLOGIES Internet Control Message Protocol ICMP author -- J. Postel, September The purpose.
ICMP (Internet Control Message Protocol) Computer Networks By: Saeedeh Zahmatkesh spring.
© Janice Regan, CMPT 128, CMPT 371 Data Communications and Networking Network Layer ICMP and fragmentation.
IP (Internet Protocol) –the network level protocol in the Internet. –Philosophy – minimum functionality in IP, smartness at the end system. –What does.
G64INC Introduction to Network Communications Ho Sooi Hock Internet Protocol.
The Network Layer. Network Projects Must utilize sockets programming –Client and Server –Any platform Please submit one page proposal Can work individually.
TCOM 509 – Internet Protocols (TCP/IP) Lecture 03_a
1 IP: putting it all together Part 2 G53ACC Chris Greenhalgh.
Internet Control Message Protocol (ICMP). Objective l IP and ICMP l Why need ICMP? l ICMP Message Format l ICMP fields l Examples: »Ping »Traceroute.
TCP/IP Essentials A Lab-Based Approach Shivendra Panwar, Shiwen Mao Jeong-dong Ryoo, and Yihan Li Chapter 5 UDP and Its Applications.
1 Internet Protocol. 2 Connectionless Network Layers Destination, source, hop count Maybe other stuff –fragmentation –options (e.g., source routing) –error.
CMPT 471 Networking II Address Resolution IPv4 ARP RARP 1© Janice Regan, 2012.
10/13/20151 TCP/IP Transmission Control Protocol Internet Protocol.
Fall 2005Computer Networks20-1 Chapter 20. Network Layer Protocols: ARP, IPv4, ICMPv4, IPv6, and ICMPv ARP 20.2 IP 20.3 ICMP 20.4 IPv6.
TCOM 515 IP Routing. Syllabus Objectives IP header IP addresses, classes and subnetting Routing tables Routing decisions Directly connected routes Static.
Chapter 81 Internet Protocol (IP) Our greatest glory is not in never failing, but in rising up every time we fail. - Ralph Waldo Emerson.
1 Internet Control Message Protocol (ICMP) Used to send error and control messages. It is a necessary part of the TCP/IP suite. It is above the IP module.
Internetworking Internet: A network among networks, or a network of networks Allows accommodation of multiple network technologies Universal Service Routers.
CS4550 Computer Networks II IP : internet protocol, part 2 : packet formats, routing, routing tables, ICMP read feit chapter 6.
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.
1 Network Layer Lecture 15 Imran Ahmed University of Management & Technology.
Internet Protocols. Address Resolution IP Addresses are not recognized by hardware. If we know the IP address of a host, how do we find out the hardware.
1 Network Layer Lecture 16 Imran Ahmed University of Management & Technology.
Layer 3: Internet Protocol.  Content IP Address within the IP Header. IP Address Classes. Subnetting and Creating a Subnet. Network Layer and Path Determination.
Basic IP Protocol Natawut Nupairoj, Ph.D. Department of Computer Engineering Chulalongkorn University.
Sharif University of Technology, Kish Island Campus Internet Protocol (IP) by Behzad Akbari.
Internet Protocols (chapter 18) CSE 3213 Fall 2011.
CSC 600 Internetworking with TCP/IP Unit 5: IP, IP Routing, and ICMP (ch. 7, ch. 8, ch. 9, ch. 10) Dr. Cheer-Sun Yang Spring 2001.
Data Communications and Computer Networks Chapter 4 CS 3830 Lecture 19 Omar Meqdadi Department of Computer Science and Software Engineering University.
1 Chapter 4: Internetworking (Internet Protocol) Dr. Rocky K. C. Chang 16 March 2004.
1 Internetworking: IP Packet Switching Reading: (except Implementation; pp )
IP Protocol CSE TCP/IP Concepts Connectionless Operation Internetworking involves connectionless operation at the level of the Internet Protocol.
1 COMP 431 Internet Services & Protocols The IP Internet Protocol Jasleen Kaur April 21, 2016.
Packet Switch Network Server client IP Ether IPTCPData.
1 K. Salah Module 5.1: Internet Protocol TCP/IP Suite IP Addressing ARP RARP DHCP.
IP - Internet Protocol No. 1  Seattle Pacific University IP: The Internet Protocol Kevin Bolding Electrical Engineering Seattle Pacific University.
Lecture 13 IP V4 & IP V6. Figure Protocols at network layer.
Network Layer/IP Protocols 1. Outline IP Datagram (IPv4) NAT Connection less and connection oriented service 2.
Introduction to Networks
IP: Addressing, ARP, Routing
Dr. Richard Spillman Fall 2006
Network Layer Protocols
TCP/IP Transmission Control Protocol / Internet Protocol
CS 457 – Lecture 10 Internetworking and IP
Internetworking Outline Best Effort Service Model
Chapter 15. Internet Protocol
Introduction to Networks
ITIS 6167/8167: Network and Information Security
Presentation transcript:

TCP/IP TCP/IP architecture IP (Internet Protocol) and ICMP (Internet Control Message Protocol) TCP (Transmission Control Protocol)/UDP (Used Datagram Protocol) Internet Routing Multicast routing IPV6, DHCP (Dynamic Host Configuration Protocol) and mobile IP (if time is allowed)

TCP/IP is a suite of protocols Application protocols: HTTP, FTP, SMTP (over TCP) and SNMP, DNS (over UDP) Application Application 2. TCP: connection-oriented while UDP: connectionless 3. IP: connectionless datagram, routing and possible fragmentation, congestion control TCP UDP 4. Complementary protocols with IP: ICMP, ARP. 5. Different physical networks. ICMP IP ARP RARP 6. IP provides best-effort connectionless service 7. (Hierarchical) IP address. Intradomain and interdomain routing, subnet, supernet. Physical network Figure 8.1

4. In general, data link frames changes each hop. Header may contain other information such as sequence number in TCP PDUs. HTTP Request 2. Upper layer PDUs encapsulated in lower layer PDUs, generally keep unchanged during their traveling Header contains source and destination port numbers TCP Header 3. Some fields of IP datagram packets are modified during its way to destination. Header contains: source and destination IP addresses; transport protocol type IP Header 4. In general, data link frames changes each hop. Header contains: source and destination physical addresses; network protocol type FCS Ethernet Header Figure 8.2

Machine A Machine B Application Application Transport Router/Gateway Transport Internet Internet Internet Network Interface Network Interface Network Interface Network 1 Network 2 1. Upper layer is just based on lower layer’s service, not implementation. 2. Routers/gateways route packets from source to destination 3. PDUs are passed down in sender, ups and downs in routers, up in receiver. Figure 8.3

IP protocol—the heart of TCP/IP architecture IP packet IP addressing Subnet addressing IP routing Supernetting –CIDR (Classless Interdomain Routing) Address resolution / Reverse address resolution Fragmentation / /reassembly ICMP (Internet Control Message Protocol).

IP version 4 header Version IHL Type of Service Total Length Identification Flags Fragment Offset Time to Live Protocol Header Checksum Source IP Address Destination IP Address Options Padding 0 4 8 16 19 24 31 0.Fixed length of 20 bytes and variable-length up to 40 byte options then data. 1. Version: 4: current version, 5: real time stream packet (ST2), 6: IPng or IPv6. 2. IHL (Internet Header Length) in unit of 32-bit words, 5 if no options. 3. Type of Service: 3-bit priorities with 0 (normal) to 7 (control packet), 4 bits tags of requirements: delay, throughput, reliability, and cost. 1 unused bit. 4. Total Length: header + data, maximum packet length:216-1 = 65535 bytes. 5. Identification, Flags, Fragment Offset: used for fragmentation and reassembly. 6. TTL (Time-to-Live): amount of time for a packet to live, mostly interpret as # of hops. 7. Protocol: 6: TCP, 17: UDP, 1: ICMP 8. Header checksum: internet Checksum algorithm, only on header, whenever TTL change, checksum needed to be recomputed. 9. Source & destination address. 10: options: security level, source routing, timestamps 11: padding: make the header a multiple of 32-bit words. Figure 8.4

Router’s work for IP When network interface passes over IP packet to IP layer Compute the header checksum which is compared with the checksum in the header. If valid, IP entity updates TTL and recompute checksum Look up routing table to find next hop Forward to the next hop.

IP addressing A computer may have multiple IP addresses 32 bit address with two level hierarchies: network ID + host ID Routing could be based on network IDs to reduce the size of routing table Network Ids are assigned by Internet Network Information Center while host IDs are assigned by local network administrator. Five classes of networks and different number of bits for network IDs and host IDs.

Five classes of IP addresses Bit position: 0 1 2 3 8 16 31 Class A Net ID Host ID Class B 1 0 Net ID Host ID Class C 1 1 0 Net ID Host ID Class D 1 1 1 0 Multicast address Class E 1 1 1 1 Reserved for experiments 1.Class A: 7 bit network ID and 24 bit host ID, so 126 networks & 16 million hosts per network. 2.Class B: 14 bit network ID and 16 bit host ID, so 16000 networks & 64000 hosts per network. 3. Class C: 21 bit network ID and 8 bit host ID, so 2 million networks and 254 hosts per network 4. Class D: multicast addresses 6. Class E: reserved. 7. ID with all 1s or all 0s has special purpose. All 1s means broadcast, all 0s means this. Figure 8.5

IP address --IDs with all 1s and all 0s Network ID host ID all 1s all 1s broadcast to local network not all 1s all 1s broadcast to the specified network all 1s not all 1s broadcast to the specified host on all networks (?) all 0s all 0s this host all 0s not all 0s the specified host on this network not all 0s all 0s the specified network 127.x.y.z: x, y, z could be anything. Used for loopback. When a host send a packet with this address, the packet will be returned to the host. Two usages: interprocess communication on a local host via TCP/IP ; debugging purpose.

IP address—dotted decimal notation Four bytes denoted as four decimal numbers 10000000 10000111 01000100 00000101 128.135.68.5 Class A: 1.0.0.0 to 127.255.255.255 Class B: 128.0.0.0 to 191.255.255.255 Class C: 192.0.0.0 to 223.255.255.255 224.0.0.0 to 239.255.255.255 Class D: Class E: 240.0.0.0 to 247.255.255.255

Subnet addressing Original address Subnetted Net ID Host ID 1 0 Subnet ID Class B problems: a class B network (typical a university network) has about 64000 hosts. Big burden on administrator. Moreover a campus may need multiple local networks.Therefore another hierarchical level: subnet. Advantage of subneting is that outside hosts still see the hosts within the network as two levels. The length of subnet ID is variable. The subnet ID and its length is determined by subnet mask. A subnet mask consists of all 1s in network ID and subnet ID but all 0s in host ID. Figure 8.6

Design of subnets Suppose a university is assigned class B network: 150.100 Assume this university has many LANs but each LAN has no more than 100 hosts. Therefore 7 bits for hosts are enough. As a result, 9 bits for subnetworks. The subnet mask will be 11111111 11111111 11111111 10000000, i.e., 255.255.255.128 If given a IP address: 150.100.12.176, find its subnet ID: 150.100.12.176 i.e., 10010110 01100100 00001100 10110000 and 11111111 11111111 11111111 10000000 == 10010110 01100100 00001100 10000000 i.e., 150.100.12.128 The hosts within this subnet have IP addresses from 150.100.12.129 to 150.100.12.254

Address assignment with subnets and subnet routing To the rest of the Internet 150.100.0.1 150.100.12.128 150.100.12.0 150.100.12.176 150.100.12.154 150.100.12.24 150.100.12.55 150.100.12.1 150.100.15.54 150.100.15.0 150.100.15.11 150.100.12.129 150.100.12.4 1.A site with class B IP address: 150.100.0.1 2. Outside see all packets to any host within the network is to get the packets to network 150.100.0.1 3. Suppose a packet with 150.100.15.11 arrive at R1 from outside: R1 finds the subnet first by doing the following: 150.100.15.11 & 255.255.255.128 = 10010110.01100100.00001111.00001011 & 11111111.11111111.11111111.10000000 = 10010110.01100100.00001111.00000000 i.e., 150.100.15.0 R1 looks up its routing table for 150.100.15.0, which has the next hop: 150.100.12.1 (R2) R1 forwards the packet to R2. R2 does similarly to find it is H5 and forwards to H5. Figure 8.7

IP routing IP entities in sender and routers work together to route a packet from source to destination. Sender’s IP entity first looks up its routing table. If the destination is directly connected to it by a link or a LAN, the sender sends the packet to the destination directly Otherwise, the sender will send the packet to default router, which is directly connected to the sender. The router first check whether a packet is for itself. If yes, pass up to its upper layer. Otherwise look up its routing table to find the next hop and forward to the next hop. The routing table: Destination IP, next hop ID, outgoing interface, flags Flags: H flag, H=1 to a host, H=0: to a network G flag: G=1 to gateway, G=0: to destination

The order to search routing table For complete destination address, if found, then forward a packet according to next hop IP and flag G. Otherwise For destination network ID. otherwise For default router, otherwise An ICMP “host unreachable error” is sent back to the sender.

Routing table example: H5 (send an IP packet to 150.100.12.176) H1 H2 150.100.12.154 150.100.12.176 150.100.12.128 150.100.12.129 150.100.0.1 R1 To the rest of H3 H4 the Internet 150.100.12.4 150.100.12.24 150.100.12.55 150.100.12.0 150.100.12.1 R2 H5 Destination next-hop flags interface 127.0.0.1 127.0.0.1 H lo0 Default 150.100.15.54 G emd0 150.100.15.0 150.100.15.11 emd0 150.100.15.54 150.100.15.11 150.100.15.0 Figure 8.7

Routing example Suppose H5’s routing table Destination next-hop flags interface 127.0.0.1 127.0.0.1 H lo0 Default 150.100.15.54 G emd0 150.100.15.0 150.100.15.11 emd0 H5 will find default router and forward to it R2’s routing table R2 uses default router to forward the packet. Destination next-hop flags interface 127.0.0.1 127.0.0.1 H lo0 Default 150.100.12.4 G emd0 150.100.15.0 150.100.15.11 emd1 150.100.12.0 150.100.12.1 emd1

Routing example (cont.) R1’s routing table Destination next-hop flags interface 127.0.0.1 127.0.0.1 H lo0 150.100.12.176 150.100.12.176 emd0 150.100.12.0 150.100.12.4 emd1 150.100.15.0 150.100.12.1 G emd1 R2 find the entry for destination IP: 150.100.12.176 and sends out to emd0.

CIDR: classless interdomain routing Historical story: 1987, a few visionaries predicted: 100,000 networks someday, most experts pooh-poohed. 100,000th network connected in 1996. Problem: IP addresses soon run out of availability. classful addresses wastes millions of address space Three bears problem: A too large, C too small, need class B But class B is still too large for many organizations. Solution: CIDR (Classless InterDomain Routing) Allocate remaining class C networks in variable-size blocks. Examples: if a organization needs 2000 hosts, then allocate it a block of 2048 addresses, i.e., 8 contiguous class C networks. If need 8000 hosts, then allocate a block of 8192 addresses, i.e., 32 contiguous class C networks.

CIDR: classless interdomain routing (cont.) Suppose an organization is allocated four contiguous class C networks: 205.100.0.0, 205.100.1.0, 205.100.2.0, 205.100.3.0. Question: how to treat these four contiguous networks as one from outside? Network mask which will mask out one common prefix for these four networks. Question: what is the network mask for these four networks? 205.100.0.0 --- 11001101 . 01100100 . 00000000 . 00000000 205.100.1.0 --- 11001101 . 01100100 . 00000001 . 00000000 205.100.2.0 --- 11001101 . 01100100 . 00000010 . 00000000 205.100.3.0 --- 11001101 . 01100100 . 00000011 . 00000000 The common prefix: 11001101 . 01100100 . 000000 Therefore, network mask: 11111111 . 11111111 . 11111100 . 00000000, i.e., 255.255.252.0 In routing table, instead of putting all four networks entries, just put one entry: 205.100.0.0/22, where 22 indicates the network mask is 22 bits. CIDR is also called supernetting because it “supernets” multiple networks into one.

A few discussions about CIDR it is possible that both supernet 205.100.0.0/22 and 205.100.0.0/20 appear in the routing table. Therefore, the IP address 205.100.1.1 will match both of them. Solution: longest prefix match. 205.100.1.1 will match 205.100.0.0/22. A prefix of arbitrary length, along with the network mask of the same length, indicates a network number. The multiple contiguous networks can not begin at a random class C network address but must begin at certain boundary. E.g., 16 contiguous networks (i.e., 4096 addresses) can not begin at 194.24.8.0. Instead, they must lie on a 4096-byte boundary. Such as begin from 194.24.16.0 through 194.24.31.0. Go to Tanenbaum for more discussion.

Fragmentation and Reassembly MTU (maximum transmission unit): a network generally has its MTU Ethernet: 1500 bytes, FDDI: 4464 bytes Fragmentation an IP packet if it is larger than MTU Reassembly all packets of an IP packet into the original IP packet at receiver.

Packet fragmentation Fragmentation takes place at the sender / routers Source Router Destination IP IP Network Network Fragmentation takes place at the sender / routers Reassembly takes place at the receiver. Figure 8.9

Fragmentation fields in IP header Identification (16 bits): identify which IP packet a particular fragment belongs to. Unique regarding IP packets destined to the same host. Flags (3 bits): one unused, one is “don’t fragment” (DF) bit, another is “more fragment” (MF). When DF is 1, then the IP packet is not allowed to fragment. At this time, if the packet is longer than the underlying MTU, then the packet will be discarded and an error will be sent to source. Offset (13 bits): indicate the location of a fragment in a packet. Since maximum IP packet length is 216, the offset is in the unit of 216/213 =8 bytes. In summary: an IP packet with DF=0 is fragmented into several fragments with the same identification, all of which set MF=1 except the last fragment which keeps its IP packet’s MF. The receiver will reassembly all these segments with the same identification into its original IP packet based on the three fields in these fragments.

Example—fragment a IP packet Suppose a packet of 20 header plus 1484 data arrives at an X.25 network having an MTU of 576 bytes, do the fragmentation. Analysis: maximum fragment=576-20=556 bytes. 556 is not the multiple of 8, thus set data length to 552. break 1484 into 552+552+380. Therefore 3 fragments. Total length ID MF Offset 1504 x 0 0 572 x 1 0 572 x 1 69 400 x 0 138 Original packet Fragment 1 Fragment 2 Fragment 3

Further segmentation Suppose the next network has MTU 324. So data is 324-20 =304, which is a multiple of 8 Fragment 1: 572 x 1 0 Fragment 11: 324 x 1 0 Fragment 12: 268 x 1 38 Fragment 2: 572 x 1 69 Fragment 21: 324 x 1 69 Fragment 22: 268 x 1 107 Fragment 3: 400 x 0 138 Fragment 31: 324 x 1 138 Fragment 32: 96 x 0 176

A few words about fragmentation Question: Do all the fragments travel along the same path? NO. Question: can reassembly be done by routers, not by receiver? NO. Because fragments will travel along possible different paths, a router can not get all the fragments corresponding a packet 2. Even it happens that all the fragments arrive at the same router which can reassembly them, it is possible that the reassembled packet be fragmented again. 3. Fragmentation is easy but reassembly is difficult because the fragments may arrive out of order, letting routers do reassembly will make routers complicated, thus violate IP motivation and end-to-end argument. Fragmentation results in subtle performance penalty: if any fragment lost or error, All fragments needs to be retransmitted.

Address Resolution –ARP (Address Resolution Protocol) H1 H2 H3 H4 ARP request (what is the MAC address of 150.100.76.22?) ARP response (my MAC address is 08-00-5A-C5-3B-94) 150.100.76.20 150.100.76.21 150.100.76.22 150.100.76.23 The way for a host to find the physical address for a IP address. Suppose H1 wants to find the physical address of H3: 1. H1 broadcasts a ARP request: what is the MAC address of 150.100.76.22? 2. (only) H3 gives ARP response: my MAC address is 08-00-5A-C5-3B-94. H1 will cache H3’s MAC address for future use. Timer is needed to remove the cached pair of IP and MAC addresses after certain time in case of MAC address change. Figure 8.8

RARP---Reverse Address Resolution Protocol The MAC address of a host may be known, but the IP address is not. E.g., a diskless computer at boot time can read its MAC address but does not know its IP address, which is stored at a server. RARP: getting IP address of a MAC address. The host broadcasts a RARP request: what is the IP address of such a MAC address The server containing the IP address gives RARP response: the IP address of such a MAC address is so so.

ICMP: Intenet Control Message Protocol Deal with error and control messages ICMP messages are encapsulated in IP packet, but ICMP is considered in the same layer as IP. Some message types: echo request/reply, timestamp request/reply, destination unreachable, source quench, redirect, time exceeded, parameter problem Examples: echo request/reply is used by ping program. Time exceeded message is used in traceroute program: Source host (running traceroute) sends messages to the destination with TTL incremented by one per message, beginning from 1. When a message arrive at a router and its TTL =0, the router will send a time exceeded message back to source host, with the router included in the message.