Вы находитесь на странице: 1из 26

The Internet Protocol Suite

Oxford Brookes University Internet Protocols K. Basu


1
The Internet Protocol Suite
• Internet Addressing
• Address resolution protocols
– ARP
– RARP
• IP fragmentation & reassembly
• Internet Protocol
– IP version 4
• Transport Protocols
– UDP
– TCP
• Internet Application Protocols

Oxford Brookes University Internet Protocols K. Basu


2
Internet Protocol

• Provides best-effort datagram service


– No facility to identify and recover from lost or
corrupted packet
• Works in conjunction with the routing protocol
• Specifies rules for datagram processing by routers
– error handling
– discarding
– fragmentation

Oxford Brookes University Internet Protocols K. Basu


3
Internet Addressing
• Internet Addresses are 32 bit
– Network Identifier + host identifier
• There are 5 classes of address
0 8 16 24 31 Range of Host Addresses
Class A 0 net id host id 1.0.0.0 - 127.255.255.255

Class B 10 net id host id 128.0.0.0 - 191.255.255.255

Class C 110 net id host id 192.0.0.0 - 223.255.255.255

Class D 1110 multicast address 224.0.0.0 - 239.255.255.255


Class E 1 1 1 1 0 reserved for future use 240.0.0.0 - 247.255.255.255

Class A caters for 126 networks each with 16,777,214 hosts


Class B caters for 16382 networks each with 65,534 hosts
Class C caters for 2.097,150 networks each with 254 hosts
Oxford Brookes University Internet Protocols K. Basu
4
Special address Convention
• All 0’s
– Only allowed at system start-up
– Host does not know its id or network id
– Initialisation
• All 0’s + host id
– Only allowed at system start-up
– Host id known but not network id
– Host on the local network
• All 1’s
– Local network broadcast
• Net id + all 1’s
– Directed broadcast for net
• 127 + anything
– Loopback
– Should never appear on the network

Oxford Brookes University Internet Protocols K. Basu


5
Address Resolution Protocol
• IP address must map onto physical address
• Host must somehow discover the physical address of a
target host on the same network given the target’s IP
address
• ARP
– Host broadcast ARP request containing target IP address
– Target responds with ARP reply containing physical
address
• Machines cache IP to physical address bindings
– Broadcast is expensive
– A cache prevents frequent broadcast
– Entries must be removed after a fixed time to enable
replacement of hardware
Oxford Brookes University Internet Protocols K. Basu
6
Reverse Address Resolution Protocol
• Diskless workstation must be able to discover their IP
address
• RARP servers have IP/physical address mappings
• RARP
– Client broadcast RARP message containing its own
physical address
– All machines on network receive message
– RARP servers reply with message containing client’s IP
address
– Client stores IP address in memory and does not need
RARP server again until reboot

Oxford Brookes University Internet Protocols K. Basu


7
Datagram Fragmentation

• Ideally datagram should be encapsulated into a single network


frame
• However, datagram may have to move across several physical
networks with varying frame sizes (e.g. maximum Ethernet
frame size is 1500 octets whereas ATM cell size is 53 octets)

Frame Relay ATM

1500

1500 4500 53

Maximum frame size

Oxford Brookes University Routing


Internet Protocols K. Basu
packet 8
Datagram Fragmentation
Two main policies:
a)
– Discover path’s maximum transfer unit (MTU)
– Limit datagram size to smallest network frame size
– Inefficient in terms of resource utilisation (viz. header overhead,
router processing, etc)

Frame Relay ATM

53 53

53 53

Oxford Brookes University Internet Protocols K. Basu


9
Datagram Fragmentation
b)
– Allow larger datagram making the protocol independent of the
network technologies
– Datagrams must be fragmented when network frame size is smaller
than the datagram size
– Each fragment contains a datagram header
– Fragments are reassembled either at the destination host (non-
transparent fragmentation) or at the egress router of the subnet
(transparent fragmentation)

Frame Relay ATM


53
1500
1500 53
Non-transparent fragmentation
Oxford Brookes University Internet Protocols K. Basu
10
Fragmentation example
Host Host
A B

Max physical frame size Max physical frame size


1500 octets 1500 octets
G Max physical frame size 600 G
octets
Datagram

Header 600 Octets 600 Octets 200 Octets

Fragment 1
Header 600 Octets

Fragment 2
Header 600 Octets

Fragment 3
Header 200 Octets

Oxford Brookes University Internet Protocols K. Basu


11
The Internet Datagram
• Divided into header and data areas
• Datagram format
0 8 16 24 31
VERS HELN SERVICE TYPE TOTAL LENGTH
IDENTIFICATION FLAGS FRAGMENT OFFSET
TIME TO LIVE PROTOCOL HEADER CHECKSUM

SOURCE IP ADDRESS
DESTINATION IP ADDRESS

IP OPTION (IF ANY) PADDING

DATA

Oxford Brookes University Internet Protocols K. Basu


12
Datagram Header Fields (1)
• VERS
– The IP protocol header version number
• HELN
– Header length in 32 bit words
– Commonly 5 if there are no options
• TOTAL LENGTH
– Length of total datagram in octets
– Maximum size of datagram is 65,535 octets
• SERVICE TYPE
– PRECEDENCE indicate importance of datagram
– D low delay request
– T high throughput request
– R high reliability request

Oxford Brookes University Internet Protocols K. Basu


13
Datagram Header Fields (2)
• IDENTIFICATION
– Unique integer that identifies the datagram
• FLAGS Together uniquely
identifies the
– DF Do not fragment bit fragments of an IP
• Datagram should not be fragmented packet
• If fragmentation required, discard datagram and return an error
– MF More fragment bit
• More fragment of the datagram to follow
• All fragments except the last one have this bit set
• FRAGMENT OFFSET
– Offset of fragment within original datagram
• TIME TO LIVE
– Length of time in seconds that the datagram may remain in the network
• PROTOCOL
– Specifies which high level protocol created the datagram

Oxford Brookes University Internet Protocols K. Basu


14
Datagram Header Fields (3)
• HEADER CHECKSUM
– One’s complement addition of the six 16-bit header values
– Note that the checksum does not apply to the data
• SOURCE ADDRESS
– 32-bit IP address of datagram sender
• DESTINATION ADDRESS
– 32-bit IP address of datagram recipient
• IP options
– Variable length field dependent on the number and type of options
– Used to help moniter and control the Internet
• Padding
– Used to make header a whole number of 32-bit words

Oxford Brookes University Internet Protocols K. Basu


15
User Datagram Protocol (UDP)
• Provides unreliable datagram transport
• Is a thin transport protocol
• Enables datagrams to be sent and received from process
within a machine
UDP SOURCE PORT UDP DESTINATION PORT
UDP LENGTH UDP CHECKSUM
DATA

Two 16-bit port numbers are defined

Oxford Brookes University Internet Protocols K. Basu


16
User Datagram Protocol (UDP)

• Length field is the numbers of octets including UDP


header
• Port numbers:
• Some port numbers are “well known” (<1023)
– 21 for ftp, 23 for telnet
• Other port numbers can be assigned dynamically

Oxford Brookes University Internet Protocols K. Basu


17
Transport Control Protocol (TCP)
• Provides reliable connection oriented service
• TCP connections
– Virtual circuit based
– Full duplex connections
– A connection is defined by a pair of end
points
– An endpoint is a (host, port) pair
– eg 145.23.4.3., 1876
154.23.5.6, 345 Application data

• The stream of octets is divided into segments


TCP Segment
• Each segment is encapsulated in an IP
datagram IP TCP Segment

Oxford Brookes University Internet Protocols K. Basu


18
3-way Handshake for TCP connection establishment

Host A Host B

• Connection establishment is
SYN, Seq_
by three way handshake no = x

• Connection terminates by a
modified three way , Ack_ no = x+1
CK
q_ no = y, A
handshake SYN, Se

– Asymmetric release
– Symmetric release Seq_no
= x+1,
ACK,
Ack_n
o = y+1

Oxford Brookes University Internet Protocols K. Basu


19
TCP Sliding Window
• Responsible for flow, error and congestion control
– Receiving window (WR)
– Based on the buffer size
– Receiver tells sender number of octets it can receive
– WR = 0 means buffer full
– Receiver acknowledges only contiguous octets received
– If sender times out on a segment then it must retransmit and
wait for acknowledgement
– The amount of retransmission and the new timeout interval
depends on the congestion window (WC)

Oxford Brookes University Internet Protocols K. Basu


20
TCP Congestion Control
• Congestion is caused by queuing delays in routers
(typically caused by overloaded link or router)
– results in severely delayed, or lost packets
• TCP assumes that all loss is due to congestion
• Upon loss of a segment
– Threshold is reduced to half of the current congestion window (WC)
– Retransmission timeout is doubled
• To avoid congestion again use a slow start
– Start with a congestion window window size of one segment
– Double the size of congestion window as each segment is acknowledged
till threshold is reached and thereafter increase window size linearly
• Effective size of the Sender’s Window(WS)=min (WR,WC)

Oxford Brookes University Internet Protocols K. Basu


21
TCP Congestion Control

Timeout
44
40
36
C o n g e s t io n W in d o w

32
28
Threshold
24
20
16
12
8
4
0
1 4 7 10 13 16 19 22 25
Transmission Number

Oxford Brookes University Internet Protocols K. Basu


22
TCP Segment Format

0 8 16 24 31

SOURCE PORT DESTINATION PORT


SEQUENCE NUMBER
ACKNOWLEDGEMENT NUMBER

HELN RESERVED CODE BITS WINDOW

CHECKSUM URGENT POINTER

IP OPTION (IF ANY) PADDING

DATA

Oxford Brookes University Internet Protocols K. Basu


23
TCP Header Fields (1)
• SOURCE PORT
– Source application process
• DESTINATION PORT
– Destination application process Operate at the octet level

• SEQUENCE NUMBER
– Position (offset) of the (start of) data segment in the byte stream
• ACKNWLEDGEMENT NUMBER
– Position (offset) of the (start of) next segment expected in the byte
stream
• HELN
– Length of header in 32-bit multiples
• RESERVED
– For future use

Oxford Brookes University Internet Protocols K. Basu


24
TCP Header Fields (2)
• CODE BITS
– Purpose and contents of segments
• WINDOW
– How much receive buffer space is available
• CHECKSUM
– Computed for
• TCP data
• TCP header
• Pseudo header (IP addresses and protocol fields)
• URGENT POINTER
– Enables out of band data to be sent
• OPTIONS
– Used for maximum segments size negotion

Oxford Brookes University Internet Protocols K. Basu


25
Internet Applications
• HTTP TCP
– World-Wide Web application access
• TELNET TCP
– Remote terminal access
• FTP TCP
– File transfer protocol
• SMTP TCP
– Simple mail transfer protocol
• NFS UDP
– Network File System (Sun)
• VoIP UDP/TCP
– Voice over IP applications

Oxford Brookes University Internet Protocols K. Basu


26