Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

Outline

[Comer] - ch. 4, 5, 6, 7, 9, 10 & 23 [Stevens] - ch. 3, 4, 5, 6, 7, 8 Obs: important (*)

Introduction Internetworking Issues

Internetworking with TCP/IP (ETC003) Lecture 2: Internet Protocol IPv4

Internet Network Layer IP Adjunct Protocols IPv4 Service Model IPv4 Datagram Format IP Service Primitives IPv4 Addressing
Adrian Popescu, 2003, 2004

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 2

1/26

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 2

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)

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 2

3/26

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 2

4/26

Internetworking Issues

Internetworking Issues (cont.)


Overall requirements Services provided to the TL Naming Addressing Routing Internetworking Quality of Service Maximum packet size Flow and error control Congestion control Error reporting Network layer structure Architectural approaches ....

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

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 2

6/26

Internet Network Layer

IP Adjunct Protocols

AL TL: TCP, UDP


Routing protocols path selection RIP, OSPF, BGP IP protocol addressing convent. datagram format packet handling conventions Routing table

AP

AP

AP

AP

TL

TCP

UDP

IP ICMP OSPF, ... IGMP

NL
ICMP protocol error reporting router "signaling"

NL

ARP

RARP

ARP

RARP

DLL: MAC & LLC PHY

DLL PHY

DLL

PHY

Network Point of Attachment

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 2

7/26

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 2

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)

Some important addresses:


RFC editor home page: www.rfc-editor.org RFC HyperText Archive: www.sunsite.auc.dk/RFC InterNic (Internet domain name registration services): www.internic.net IANA (Internet Assigned Numbers Authority - central coordination functions): www.iana.org ICANN (Internet Cooperation for Assigned Names and Numbers technical coordination body for the Internet): www.icann.org
Dept of Telecommunications & Signal Processing
Internetworking with TCP/IP - ETC003 - Lecture 2 10/26

IPv4 Datagram Format


Bit 0 Version 4 IHL 8 Type of Service Flags 16 19 Total Length Fragment Offset Header Checksum 31

IPv4 Datagram Format (cont.)


Total Length (16 bits): total datagram length (Header & Data), in octets Identication (16 bits): used to manage the segmentation/fragmentation process; together with the source address, destination address and user protocol, Identication eld is used to identify a datagram uniquely (for the destination) for the time during which the datagram is in the Internet Flags (3 bits): only two of them are currently used; The More bit is used for fragmentation & reassembly The Dont Fragment bit prohibits fragmentation when set; the datagram will then be discarded if it exceeds the maximum size of an en route network Fragment Offset (13 bits): indicates (position) where in the original datagram the specic fragment belongs, measured in 64-bit units Time to Live (TTL - 8 bits): species how long, in seconds, a datagram is allowed to remain in the Internet; every router that processes a datagram must decrease the TTL by at least one (i.e., decreased with 1 sec/router) Protocol (8 bits): indicates the next higher layer protocol to receive the data eld at destination Header Checksum (16 bits): an error-detecting code is applied to the IP header only; this code is reveried and recomputed at each router

Identification 20 bytes (min) Time to Live (TTL) Protocol

65,536 bytes (max)

Source Address Destination Address Options & Padding

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

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 2

12/26

IPv4 Datagram Format (cont.)


Source Address (32 bits): to allow a variable number of bits to specify the network (and the subnetwork) and the host address of the transmitting host Destination Address (32 bits): to allow a variable number of bits to specify the network (and the subnetwork) and the host address of the receiving host Options (variable): rarely used today, this eld allows an IP header to be extended; it encodes the options requested by the sending user to carry specic functionalities, to request for a particular routing for some packets; currently dened options are: security; source routing; route recording; stream identication; timestamping; Padding (variable): used to ensure that the datagram header has a length that is a multiple of 32 bits Data (variable): the data eld must have a length that is an integer multiple of 8 bits; maximum datagram length (header plus data) is 65,536 octets

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 }

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 2

13/26

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 2

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

IPv4 Addressing (cont.)


Big problem: exhaustion of class B address space and explosion of routing table growth triggered by a ood of new class Cs (ROADS: Running Out of ADress Space) Solution advanced by IETF: CIDR Actually, there are two forms of addressing (with reference to the number N of bits for the network part of an IP address): Classful addressing: N constrained to 8, 16, or 24 bits only [RFC1700 & RFC1117] Classless addressing: N can be any number of bits (up to 30) used in Classless Inter-Domain Routing (CIDR) [RFC1518 & RFC1519]

1 0

NetID (14 bits)

HostID (16 bits)

Class B

1 1 0

NetID (21 bits)

HostID (8 bits)

Class C

1 1 1 0

Multicast Address (28 bits)

Class D

Accordingly, CIDR dotted decimal representation:


1 1 1 1 0 Future Use Class E

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

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 2

16/26

Subnets and Subnet Masks


A third hierarchical level was introduced in 1984 in the addressing structure, namely subnet Accordingly Address format: Prex/Network/Subnetwork/Host The Subnet eld can be of any length, and it is specied by a 32-bit mask One determines that an address belongs to a subnet by a "comparisonunder-mask" operation The effect of the Subnet Mask is to erase the portion of the Host eld, so leaving only the Network number and the Subnetwork number OBS: Prex in the Address Format is NOT the same as the Network_Prex (as indicated by the Subnet Mask); Network_Prex is indicated by a number of leftmost bits in the address according to a bitwise-AND computation of the address and the subnet mask Address format: Prex/Network/Subnetwork/Host Subnet mask: Network_Prex/Host

Special Purpose Addresses


There are some special addresses (mostly for broadcast), like 0.0.0.0: some unknown host (source address), booting purposes 255.255.255.255: "limited broadcast" address/any host (destination adress) A.255.255.255: network-directed broadcast (class A network) B.B.255.255: directed broadcast (class B network) C.C.C.255: directed broadcast (class C network) 127.0.0.1: loopback address/this host (local loop) To start a machine, one needs to know: own IP address subnet mask routers IP address DNS servers address Assigning addresses: manual conguration/static allocation (by a system administrator) dynamic allocation (Dynamic Host Conguration Protocol DHCP) Internet Network Information Center (InterNIC): authority that has the responsibility for the distribution of IP addresses

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 2

17/26

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 2

18/26

Segmentation and Reassembly


Because of limitations in max packet length due to the specic underlying network: the risk does exist for the need for segmentation & reassembly Max IP packet size: 65,536 bytes (64 kbytes) Max packet size (in link) varies in different networks and depends, among others, on bit error rate, transit delay, buffer storage requirements, etc. Max packet sizes (also known as Maximum Transfer Unit MTU) are between 128 bytes (for some public carrier networks) and 8191 bytes (and higher) for some LANs Examples of MTU: 1500 bytes (Ethernet); 4464 bytes (Token Ring); 8191 bytes (Token Bus); 4352 bytes (FDDI); and 53 bytes (ATM) Obs: there are also requirements for minimum packet size, like in the case of Ethernet (min 64 bytes) Consequences: IP must allow for segmentation & reassembly IPv4: segmentation is done at the router and reassembly at destination IPv6: does not allow for segmentation & reassembly at intermediate routers but only at terminal IPv4: uses "Identication", "Flags" and "Fragmentation Offset" elds in the datagram header for segmentation & reassembly Practically: most TPDUs (TCP segments) for bulk data transfers are of sizes 512 - 536 bytes to avoid the need for segmentation
Dept of Telecommunications & Signal Processing
Internetworking with TCP/IP - ETC003 - Lecture 2 19/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

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 2

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

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 2

21/26

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 2

22/26

Finding the Local Router


Discovery procedures: Static Dynamic: using special ICMP messages of types "advertisements" and "solicitations"

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;

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 2

23/26

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 2

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

Generic Router Architecture


A router has four components: Input ports: with functions at PHY, DLL & lookup and forwarding levels Switching fabric: connects input ports to output ports Output ports: reverse DLL & PHY functionality as Input ports Routing processor: executes the routing protocols, maintains the routing tables and performs network management functions

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 2

25/26

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 2

26/26

You might also like