Professional Documents
Culture Documents
Internetworking With TCP/IP (ETC003) : © Adrian Popescu, 2003, 2004
Internetworking With TCP/IP (ETC003) : © Adrian Popescu, 2003, 2004
Internet Network Layer IP Adjunct Protocols IPv4 Service Model IPv4 Datagram Format IP Service Primitives IPv4 Addressing
Adrian Popescu, 2003, 2004
1/26
2/26
Introduction Subnets and Subnet Masks Special Purposes Addresses Segmentation and Reassembly ICMPv4 Address Translation Finding the Local Router Datagram Delivery Routers Generic Router Architecture
Denition Internetworking
Interconnection of multiple networks (subnetworks) into an Internet Task: getting packets from the source (all the way) to the destination In order to achieve the goal, one needs to Have knowledge about the topology of the network Be able to choose appropriate path through the network Choose routes to avoid congestion (on some links) Be able to provide internetworking when the source and destination are in different networks
Some denitions
DTE: End System (ES) or Host DCE: Data Communication System Internetwork (or Internet): composite network being used (ex. LAN/WAN/LAN) Subnetwork (or Subnet): constituent network of the Internet (e.g., LAN) Intermediate System (IS) or Interworking Unit (IWU): device that interconnects two networks (e.g., bridge, router, gateway)
3/26
4/26
Internetworking Issues
Host A Operating System Applic. Layer TCP IP Network Access Protoc. 1 PHY Router IP NAP 1 NAP 2 PHY PHY
Host B Operating System Applic. Layer TCP IP Network Access Protoc. 2 PHY
Subnetwork 1 Functions:
Subnetwork 2
TCP: Error & Flow Control (end-to-end); QoS IP: Routing (Routing & Forwarding) NAP: Forwarding; Error & Flow Control (point-to-point)
Dept of Telecommunications & Signal Processing
Internetworking with TCP/IP - ETC003 - Lecture 2 5/26
6/26
IP Adjunct Protocols
AP
AP
AP
AP
TL
TCP
UDP
NL
ICMP protocol error reporting router "signaling"
NL
ARP
RARP
ARP
RARP
DLL PHY
DLL
PHY
7/26
8/26
IPv4
Two main components:
IP Services (IP <--> TCP/UDP) Protocol format & mechanisms
Service Model
IP service model:
Best-effort, connectionless service (no guarantees, only datagram delivery)
Main Components:
Addressing scheme Datagram (CL) model of data delivery
Aspects considered:
Service Model IPv4 Datagram Format IP Service Primitives IPv4 Addressing Subnets and Subnet Masks Special Purpose Addresses Segmentation and Reassembly ICMPv4 Address Translation Finding the Local Router Datagram Delivery Generic Router Architecture
Dept of Telecommunications & Signal Processing
Internetworking with TCP/IP - ETC003 - Lecture 2 9/26
IP Specs
IPv4: RFC 791 (1981) ICMP: RFC 792 (1981) ARP: RFC 826, 1027 (1982) RARP: RFC 903 (1982)
Data
Version(4 bits): indicates protocol version number Internet Header Length (IHL - 4 bits): length of header in 32-bit words Type of Service (TOS - 8 bits): species the parameters for precedence (eight levels for the datagrams relative importance), reliability (two levels: normal or high), delay (two levels: normal or low) & throughput (two levels: normal or high); TOS eld has two subelds (precedence & TOS) Actually most applications do not allow to set the TOS eld; however 4.3BSD Reno and later do support TOS; similarly does DiffServ [RFC2474]
Dept of Telecommunications & Signal Processing
Internetworking with TCP/IP - ETC003 - Lecture 2 11/26
12/26
IP Service Primitives
Service Primitives IP <--> TCP/UDP
TCP/UDP --> IP Send { Source address Destination address Protocol Type of service Identification Dont fragment identifier TTL Data length Options data Data } IP --> TCP/UDP Deliver { Source address Destination address Protocol Type of service ------Data length Options data Data }
13/26
14/26
IPv4 Addressing
Two categories of addressing: classful and classless Address format for classful addressing: Prex/Network/Host (32 bits, two-level hierarchy)
0 NetID (7 bits) HostID (24 bits) Class A
1 0
Class B
1 1 0
HostID (8 bits)
Class C
1 1 1 0
Class D
xxx.yyy.zzz.vvv/ww where ww indicates the number of leading bits in the 32-bit IP address that constitute the Network portion (example: 223.1.1.0/24) Important observation Besides IP address (NL address), there is also the so-called Hardware Address (HW); HW can be of type Link-Layer address (ISO) or MAC address (IEEE 802.3 - 48 bits address)
15/26
Dotted decimal representation: xxx.yyy.zzz.vvv (x, y, z and v between 0-9) Class A: 1.0.0.0 to 127.255.255.255 (126 network addresses: 1 - 126; 0 & 127 are reserved) Class B: 128.0.0.0 to 191.255.255.255 (214 = 16,384 network addresses) Class C: 192.0.0.0 to 223.255.255.255 (221 = 2,097,152 network addresses) Class D: 224.0.0.0 to 239.255.255.255 (228 network addresses) [RFC1112]
Dept of Telecommunications & Signal Processing
Internetworking with TCP/IP - ETC003 - Lecture 2
16/26
17/26
18/26
ICMPv4
There are lots of problems related to IP that may go wrong, e.g., packets may be dropped at routers, routes may be wrongly congured, packets may become corrupted, TTL expires, etc. IP may detect some of the errors, and uses ICMP to report the errors ICMP is used by hosts, routers & gateways to communicate NL information to each other, mostly for signaling/diagnosing error conditions; it provides feedback information about network problems [RFC792]; also, it does NOT necessarily correct errors Most ICMP packets/messages are "diagnostic" information that is sent back to the source when a router destroys a packet, for instance when the routing can not be solved ("destination unreachable"), or when TTL expires ("time exceeded") or when a router detects a congestion ("source quench") ICMP also denes an "echo" function that can be used for testing connectivity (ping) ICMP is (often) considered as part of IP, but architecturally it lies just above IP, as ICMP messages are carried inside IP datagrams (i.e., ICMP messages are carried as IP payload, similarly to TCP/UDP) Programs that are using ICMP: ping, traceroute
20/26
ICMPv4 (cont.)
ICMP messages have the format Type/Code/Checksum and also contain the rst eight bytes of the IP datagram (together with the Header) that caused the ICMP message to be generated in the rst place (such as the sender can determine the packet that caused the error)
0 Type 8 Code Unused IP Header + first 8 bytes of the original data Datagram 16 Checksum 31
Address Translation
Translation between IP addresses (IP) and network/media addresses (MAC): Address Resolution Protocol (ARP): IP --> MAC [RFC826] Reverse Address Resolution Protocol (RARP): MAC --> IP [RFC903] ARP/RARP lies architecturally just below IP, as ARP/RARP messages are carried inside MAC frame (i.e., ARP/RARP messages are carried as MAC payload, similarly to IP) Variants of ARP/RARP have been dened for many networking technologies, such as Ethernet/IEEE802.3 (not only Ethernet, but also any of IEEE802 technologies, including Token Ring IEEE802.5), FDDI, SMDS, etc.; in the case of WAN the situation is more complex and the address is set by a Network Management operation (typically used for X.25, FR, ATM) Programs that are using ARP: arp (comment: ARP request is an Ethernet broadcast) Lists of IP/MAC address pairs are in proxy ARP memory (routers/gateways), ARP cache memory (hosts) and proxy ARP routers
ICMP Type 0 3 3 3 3 3 3 4 8 9 10 11 12
Code 0 0 1 2 3 6 7 0 0 0 0 0 0
Description several messages echo reply (to ping) destination network unreachable destination host unreachable destination protocol unreachable destination port unreachable destination network unknown destination host unknown source quench (congestion control) echo request router advertisement router discovery/solicitation TTL expired parameter problem/IP header bad
21/26
22/26
Datagram Delivery
IP Routing Algorithm (for both hosts and routers): Route_IP_Datagram (Datagram DAT, Routing_Table RT, Subnet_Mask M) extract Destination IP address (D) from the Datagram DAT and compute the Network Prex (N) by bitwise-AND of D and Subnet Mask M if N matches any directly connected network address (own interfaces) deliver datagram to destination D over that network (this involves resolving D to a physical address, encapsulating the Datagram DAT and sending the frame) else if RT contains a host-specic route for D send DAT to the next-hop router specied in RT (obs: next-hop MUST lie on a directly connected network) else if RT contains a route for network N send DAT to the next-hop router specied in RT else if RT contains a default route for network N send DAT to the default router specied in RT else if no matches are found declare a routing error;
23/26
24/26
Routers
Devices that connect heterogeneous physical networks together Routers differ from switches in the sense that the network types to be connected need NOT be the same A router has a hardware component (to handle the physical/data link layer protocols) and hardware/software to handle the network layer protocols Routers can have more than two network interfaces
25/26
26/26