Vous êtes sur la page 1sur 5

Outline

Introduction

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

Internetworking Issues
Internet Network Layer

Internetworking with TCP/IP (ETC003)

IP Adjunct Protocols

Lecture 2: Internet Protocol IPv4

IPv4
Service Model
IPv4 Datagram Format
IP Service Primitives
IPv4 Addressing
Adrian Popescu, 2003, 2004
1/26

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 2

Dept of Telecommunications & Signal Processing

2/26

Internetworking with TCP/IP - ETC003 - Lecture 2

Introduction
Subnets and Subnet Masks
Definition Internetworking

Special Purposes Addresses

Interconnection of multiple networks (subnetworks) into an Internet


Task: getting packets from the source (all the way) to the destination

Segmentation and Reassembly

In order to achieve the goal, one needs to

ICMPv4

Have knowledge about the topology of the network

Address Translation

Choose routes to avoid congestion (on some links)

Be able to choose appropriate path through the network


Be able to provide internetworking when the source and destination
are in different networks

Finding the Local Router

Some definitions

Datagram Delivery

DTE: End System (ES) or Host


DCE: Data Communication System

Routers

Internetwork (or Internet): composite network being used


(ex. LAN/WAN/LAN)

Generic Router Architecture

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

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 2

Internetworking Issues (cont.)

Host B
Applic.
Layer

Applic.
Layer
TCP

Router

IP

IP

IP

NAP 1 NAP 2

Network
Access
Protoc. 2

PHY

PHY

TCP

PHY

PHY

Subnetwork 1

Operating System

Host A
Operating System

4/26

Internetworking with TCP/IP - ETC003 - Lecture 2

Internetworking Issues

Network
Access
Protoc. 1

Dept of Telecommunications & Signal Processing

Subnetwork 2

Functions:
TCP: Error & Flow Control (end-to-end); QoS

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
....

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

AP

AP

AP

AP

TL: TCP, UDP


TL

Routing protocols
path selection
RIP, OSPF, BGP

TCP

addressing convent.
datagram format
packet handling
conventions

IP
IGMP

ICMP
OSPF, ...

Routing

NL

table

NL

ICMP protocol
error reporting
router "signaling"

ARP

UDP

IP protocol

ARP

RARP

RARP

DLL: MAC & LLC

DLL

DLL

PHY
PHY

PHY

Network Point of Attachment

7/26

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 2

Dept of Telecommunications & Signal Processing

8/26

Internetworking with TCP/IP - ETC003 - Lecture 2

IPv4

Service Model

Two main components:

IP service model:

IP Services (IP <--> TCP/UDP)

Best-effort, connectionless service (no guarantees, only datagram delivery)

Main Components:

Protocol format & mechanisms

Addressing scheme

Aspects considered:

Datagram (CL) model of data delivery

IP Specs

Service Model
IPv4 Datagram Format

IPv4: RFC 791 (1981)

IP Service Primitives

ICMP: RFC 792 (1981)

IPv4 Addressing

ARP: RFC 826, 1027 (1982)

Subnets and Subnet Masks

RARP: RFC 903 (1982)

Special Purpose Addresses

Some important addresses:

Segmentation and Reassembly

RFC editor home page: www.rfc-editor.org

ICMPv4

RFC HyperText Archive: www.sunsite.auc.dk/RFC

Address Translation

InterNic (Internet domain name registration services): www.internic.net

Finding the Local Router

IANA (Internet Assigned Numbers Authority - central coordination functions): www.iana.org

Datagram Delivery

ICANN (Internet Cooperation for Assigned Names and Numbers technical coordination body for the Internet): www.icann.org

Generic Router Architecture


9/26

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 2

0
Version

20 bytes (min)

65,536 bytes (max)

19

Type of Service

Identification
Time to Live (TTL)

IPv4 Datagram Format (cont.)


16

8
IHL

31

Total Length (16 bits): total datagram length (Header & Data), in octets

Total Length
Flags

Identification (16 bits): used to manage the segmentation/fragmentation


process; together with the source address, destination address and user
protocol, Identification field is used to identify a datagram uniquely (for
the destination) for the time during which the datagram is in the Internet

Fragment Offset
Header Checksum

Protocol

Flags (3 bits): only two of them are currently used;

Source Address

The More bit is used for fragmentation & reassembly

Destination Address

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

Options & Padding

Data

Fragment Offset (13 bits): indicates (position) where in the original datagram the specific fragment belongs, measured in 64-bit units
Time to Live (TTL - 8 bits): specifies 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)

Version(4 bits): indicates protocol version number


Internet Header Length (IHL - 4 bits): length of header in 32-bit words

Protocol (8 bits): indicates the next higher layer protocol to receive the
data field at destination

Type of Service (TOS - 8 bits): specifies 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 field has two subfields (precedence & TOS)
Actually most applications do not allow to set the TOS field; 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

10/26

Internetworking with TCP/IP - ETC003 - Lecture 2

IPv4 Datagram Format


Bit

Dept of Telecommunications & Signal Processing

Header Checksum (16 bits): an error-detecting code is applied to the IP


header only; this code is reverified and recomputed at each router

11/26

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 2

12/26

IPv4 Datagram Format (cont.)

IP Service Primitives

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

Service Primitives IP <--> TCP/UDP

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

TCP/UDP --> IP
Send {
Source address
Destination address
Protocol
Type of service
Identification
Dont fragment identifier
TTL
Data length
Options data
Data
}

Options (variable): rarely used today, this field allows an IP header to be


extended; it encodes the options requested by the sending user to carry
specific functionalities, to request for a particular routing for some packets; currently defined options are: security; source routing; route recording; stream identification; timestamping;
Padding (variable): used to ensure that the datagram header has a length
that is a multiple of 32 bits

IP --> TCP/UDP
Deliver {
Source address
Destination address
Protocol
Type of service
------Data length
Options data
Data
}

Data (variable): the data field must have a length that is an integer multiple of 8 bits; maximum datagram length (header plus data) is 65,536
octets

13/26

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 2

IPv4 Addressing (cont.)


Big problem: exhaustion of class B address space and explosion of routing
table growth triggered by a flood of new class Cs (ROADS: Running Out of
ADress Space)

Two categories of addressing: classful and classless


Address format for classful addressing:
Prefix/Network/Host (32 bits, two-level hierarchy)
NetID (7 bits)

1 0

Solution advanced by IETF: CIDR

HostID (24 bits)

NetID (14 bits)

1 1 0

14/26

Internetworking with TCP/IP - ETC003 - Lecture 2

IPv4 Addressing

Dept of Telecommunications & Signal Processing

HostID (16 bits)

NetID (21 bits)

Actually, there are two forms of addressing (with reference to the number
N of bits for the network part of an IP address):

Class A

HostID (8 bits)

Classful addressing: N constrained to 8, 16, or 24 bits only [RFC1700 &


RFC1117]

Class B

Classless addressing: N can be any number of bits (up to 30)

Class C

used in Classless Inter-Domain Routing (CIDR) [RFC1518 & RFC1519]


1 1 1 0

Multicast Address (28 bits)

Class D

1 1 1 1 0

Future Use

Class E

Accordingly, CIDR dotted decimal representation:


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)

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)

Important observation

Class B: 128.0.0.0 to 191.255.255.255 (214 = 16,384 network addresses)

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)

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

15/26

Internetworking with TCP/IP - ETC003 - Lecture 2

Dept of Telecommunications & Signal Processing

16/26

Internetworking with TCP/IP - ETC003 - Lecture 2

Subnets and Subnet Masks

Special Purpose Addresses


There are some special addresses (mostly for broadcast), like

A third hierarchical level was introduced in 1984 in the addressing structure, namely subnet

0.0.0.0: some unknown host (source address), booting purposes

Accordingly

255.255.255.255: "limited broadcast" address/any host (destination adress)

Address format: Prefix/Network/Subnetwork/Host

A.255.255.255: network-directed broadcast (class A network)

The Subnet field can be of any length, and it is specified by a 32-bit mask

B.B.255.255: directed broadcast (class B network)

One determines that an address belongs to a subnet by a "comparisonunder-mask" operation

C.C.C.255: directed broadcast (class C network)


127.0.0.1: loopback address/this host (local loop)

The effect of the Subnet Mask is to erase the portion of the Host field, so
leaving only the Network number and the Subnetwork number

To start a machine, one needs to know:

OBS: Prefix in the Address Format is NOT the same as the Network_Prefix
(as indicated by the Subnet Mask); Network_Prefix is indicated by a
number of leftmost bits in the address according to a bitwise-AND computation of the address and the subnet mask

own IP address
subnet mask
routers IP address

Address format: Prefix/Network/Subnetwork/Host

DNS servers address

Subnet mask: Network_Prefix/Host

Assigning addresses:
manual configuration/static allocation (by a system administrator)
dynamic allocation (Dynamic Host Configuration 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

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 configured, packets
may become corrupted, TTL expires, etc.

Because of limitations in max packet length due to the specific underlying


network: the risk does exist for the need for segmentation & reassembly
Max IP packet size: 65,536 bytes (64 kbytes)

IP may detect some of the errors, and uses ICMP to report the errors

Max packet size (in link) varies in different networks and depends, among
others, on bit error rate, transit delay, buffer storage requirements, etc.

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

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

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")

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

ICMP also defines an "echo" function that can be used for testing connectivity (ping)

IPv4: segmentation is done at the router and reassembly at destination

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)

IPv6: does not allow for segmentation & reassembly at intermediate routers but only at terminal
IPv4: uses "Identification", "Flags" and "Fragmentation Offset" fields in the
datagram header for segmentation & reassembly

Programs that are using ICMP: ping, traceroute

Practically: most TPDUs (TCP segments) for bulk data transfers are of
sizes 512 - 536 bytes to avoid the need for segmentation
19/26

Dept of Telecommunications & Signal Processing


Internetworking with TCP/IP - ETC003 - Lecture 2

Dept of Telecommunications & Signal Processing

20/26

Internetworking with TCP/IP - ETC003 - Lecture 2

ICMPv4 (cont.)

Address Translation

ICMP messages have the format Type/Code/Checksum and also contain the
first eight bytes of the IP datagram (together with the Header) that
caused the ICMP message to be generated in the first place (such as the
sender can determine the packet that caused the error)

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]

16

8
Type

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)

31
Checksum

Code
Unused

ICMP Type
0
3
3
3
3
3
3
4
8
9
10
11
12

Variants of ARP/RARP have been defined 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)

+ first 8 bytes of the original data Datagram

IP Header

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

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

21/26

Internetworking with TCP/IP - ETC003 - Lecture 2

Dept of Telecommunications & Signal Processing

22/26

Internetworking with TCP/IP - ETC003 - Lecture 2

Finding the Local Router

Datagram Delivery

Discovery procedures:

IP Routing Algorithm (for both hosts and routers):

Static

Route_IP_Datagram (Datagram DAT, Routing_Table RT, Subnet_Mask M)

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

extract Destination IP address (D) from the Datagram DAT


and compute the Network Prefix (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-specific route for D
send DAT to the next-hop router specified 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 specified in RT
else if RT contains a default route for network N
send DAT to the default router specified 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

Generic Router Architecture

Devices that connect heterogeneous physical networks together

A router has four components:

Routers differ from switches in the sense that the network types to be
connected need NOT be the same

Input ports: with functions at PHY, DLL & lookup and forwarding levels
Switching fabric: connects input ports to output ports

A router has a hardware component (to handle the physical/data link


layer protocols) and hardware/software to handle the network layer protocols

Output ports: reverse DLL & PHY functionality as Input ports


Routing processor: executes the routing protocols, maintains the routing tables and performs network management functions

Routers can have more than two network interfaces

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

Vous aimerez peut-être aussi