Internet Protocol - 7th Semester Notes

Download Report

Transcript Internet Protocol - 7th Semester Notes

Internet Protocols
Chapter 18
1
Protocol Functions











Small set of functions that form basis of all protocols
Not all protocols have all functions
 Reduce duplication of effort
 May have same type of function in protocols at different levels
Encapsulation
Fragmentation and reassembly
Connection control
Ordered delivery
Flow control
Error control
Addressing
Multiplexing
Transmission services
2
Lecture Plan




Protocols Functions
Principles of Internetworking
Connectionless Internetworking
Internet protocols





IPv6




IP Services
Internet protocol
IP Addresses
ICMP
IP next generation
IPv6 structure
IPv6 Header, Addresses, fragment header, routing header
Multicasting
Protocol Functions


Small set of functions that form basis of all protocols
Not all protocols have all functions











Reduce duplication of effort
May have same type of function in protocols at different levels
Encapsulation
Fragmentation and reassembly
Connection control
Ordered delivery
Flow control
Error control
Addressing
Multiplexing
Transmission services
Encapsulation

Data usually transferred in blocks





Three categories of control
Address



E.g. frame check sequence
Protocol control


Of sender and/or receiver
Error-detecting code


Protocol data units (PDUs)
Each PDU contains data and control information
Some PDUs only control information (no data)
Additional information to implement protocol functions
Addition of control information to data is referred to as encapsulation
Data accepted or generated by entity and encapsulated into PDU


Containing data plus control information
e.g. TFTP, HDLC, frame relay, ATM, AAL5 (Figure 11.15), LLC, IEEE 802.3,
IEEE 802.11
Fragmentation and Reassembly
(Segmentation – OSI)







Protocol is concerned with exchanging data between two entities
Characterized as sequence of PDUs of some bounded size
 Application level, logical unit of data transfer as a message
Lower-level protocols may need to break data up into smaller
bounded size. This process is called Fragmentation.
Communications network may only accept blocks of up to a certain
size
 ATM 53 octets
 Ethernet 1526 octets
More efficient error control with a smaller PDU size
 Smaller retransmission when a PDU suffers an error
Fairer
 Prevent station monopolizing medium
Smaller buffers
Disadvantages of Fragmentation

Make PDUs as large as possible because

PDU contains some control information


PDU arrival generates interrupt



Smaller block, greater the percentage overhead
Smaller blocks, result in more interrupts
More time is spent, processing smaller, more
numerous PDUs
All of these factors must be taken into account
by the protocol designer in determining
minimum and maximum PDU size.
Reassembly



The counterpart of fragmentation is
reassembly
Segmented data must be reassembled into
messages appropriate to the application level
If PDUs arrive out of order, the task is
complicated
PDU’s and Fragmentation
(Copied from chapter 2 fig 2.4)
Connection Control

Connectionless data transfer



Connection-oriented data transfer




Each PDU treated independently of all prior PDU’s
E.g. datagram
E.g. virtual circuit
Connection-oriented preferred (even required) for
lengthy exchange of data
Logical association, or connection, established
between entities
Three phases occur



Connection establishment
Data transfer
Connection termination
Phases of Connection Oriented
Transfer
Connection Establishment





Entities agree to exchange data
Typically, one station issues connection request
Central authority may or may not be involved
Receiving entity accepts or rejects (simple)
May include negotiation concerning



Syntax, semantics, and timing
Both entities must use same protocol
Must be agreed

E.g. protocol may specify max PDU size 8000 octets;
one station may wish to restrict to 1000 octets
Data Transfer and Termination




Both data and control information exchanged
 e.g. flow control, error control
Data flow and acknowledgements may be in
one or both directions
One side may send termination request
Or central authority might forcibly terminate a
connection
Sequencing

Many connection-oriented protocols use sequencing




PDUs numbered sequentially
Each side keeps track of outgoing and incoming numbers
Sequencing supports three main functions




Ordered delivery
Flow control
Error control
Not found in all connection-oriented protocols


e.g. HDLC, IEEE 802.11
E.g.frame relay and ATM
All connection-oriented protocols include some way of
identifying connection


Unique connection identifier
Combination of source and destination addresses
Ordered Delivery

PDUs may arrive out of order





Different paths through network
PDU order must be maintained in connectionoriented protocols
Number PDUs sequentially
Easy to reorder received PDUs basis of
sequence no
Problem with finite sequence number field

Numbers repeat modulo maximum number

e.g. selective-repeat ARQ
Flow Control


Performed by receiving entity to limit amount or
rate of data is sent by a transmitting entity
Stop-and-wait


Credit provided to the transmitter



Each PDU must be acknowledged before next sent
Amount of data that can be sent without
acknowledgment
E.g. HDLC sliding-window
Must be implemented in several protocols



Network traffic control
Buffer space
Application overflow

E.g. Application could be hung up waiting for disk access
Error Control


Guard against loss or damage of data and control information
Error detection and retransmission

Sender inserts error-detecting code in PDU







Function of other bits in PDU
Receiver checks code on incoming PDU
If error, discard
If transmitter doesn’t get acknowledgment in reasonable time, sender
retransmits the PDU
Error-correction code
Enables receiver to detect and possibly correct errors
Error control is performed at various layers of protocol


Between station and network
Inside network
TCP/IP Concepts
Addressing Level


Level in communication architecture at which entity is
named
Unique address for each end system


And each intermediate system


(e.g., router)
Network-level address




e.g. workstation or server
IP address or internet address
OSI - network service access point (NSAP)
Used to route PDU through network
At destination data must routed to some process



Each process assigned an identifier
TCP/IP port
Service access point (SAP) in OSI
Connection Identifiers



Connection identifiers comes into play when we consider
connection-oriented data transfer rather than connection less
Connection identifier used by both entities for future
transmissions and has several advantages:
Reduced overhead


Routing



Fixed route may be defined
Connection identifier identifies route to intermediate systems
Multiplexing



Generally shorter than global identifiers
Entity may wish more than one connection simultaneously
PDUs must be identified by connection identifier
Use of state information


Once connection established, end systems can maintain state
information about connection
Flow and error control using sequence numbers
Addressing Mode

Usually address refers to single system or port


Individual or unicast address
Address can refer to more than one entity or
port



Multiple simultaneous recipients for data
Broadcast for all entities within domain
Multicast for specific subset of entities
Multiplexing

Multiple connections into single system



E.g. frame relay, can have multiple data link
connections terminating in single end system
Connections multiplexed over single physical
interface
Can also be accomplished via port names


Also permit multiple simultaneous connections
E.g. multiple TCP connections to given system

Each connection on different pair of ports
Transmission Services

A Protocol may provide additional services to entities

E.g.:
Priority



Connection basis
On message basis


Quality of service


E.g. certain classes of data may require a minimum
throughput or maximum delay threshold
Security


E.g. terminate-connection request
Security mechanisms, restricting access
These services depend on underlying transmission system
and lower-level entities
Internetworking Terms (1)

Communications Network


An internet


Collection of communications networks
interconnected by bridges and/or routers
The Internet - note upper case I


Facility that provides data transfer service
The global collection of thousands of individual
machines and networks
Intranet


Corporate internet operating within the organization
Uses Internet (TCP/IP and http)technology to deliver
documents and resources
Internetworking Terms (2)

End System (ES)



Device attached to one of the networks of an internet
Supports end-user applications or services
Intermediate System (IS)


Device used to connect two networks
Permits communication between end systems
attached to different networks
Internetworking Terms (3)

Bridge/ Switch




IS used to connect two LANs using similar LAN
protocols
Address filter passing on packets to the required
network only
OSI layer 2 (Data Link)
Router



Connects two (possibly dissimilar) networks
Uses internet protocol present in each router and end
system
OSI Layer 3 (Network)
Requirements of Internetworking


The overall requirements for an internetworking
facility are as follows:
Provide a link between networks




At Minimum physical and link control connection is
needed
Provide for the routing and delivery of data
between processes on different networks
Provide an accounting services that keeps track
of the use of the various networks and routers
and maintain status information
Provide services independent of the network
architectures
Network Architecture Features

Internetworking facility must accommodate a
number of differences among the networks
including the following:









Different addressing schemes
Different packet size
Different Network access mechanism
Different timeouts
Error recovery
Status reporting
Routing techniques
User access control
Connection based or connectionless
Architectural Approaches



A key characteristic of an internet architecture
is whether the mode of the operation is
Connection oriented
Connectionless
Connection Oriented


Assume that each network is connection oriented
IS connect two or more networks


IS appear as ES to each network
Logical connection set up between ESs



Concatenation of logical connections across networks
Individual network virtual circuits joined by IS
May require enhancement of local network
services

IEEE 802, FDDI these networks have a datagram style
of transmission, therefore network service must be
enhanced
Connection Oriented IS Functions


A connection-oriented IS performs the following
key functions:
Relaying


Routing


Data units arriving from one network via the network
layer protocol are relayed (retransmitted) on another
network. Traffic is over logical connections that are
spliced together at the ISs
When an end-to-end logical connections and the
sequence of logical connections, is to be setup, each
IS in the sequence must make a routing decision that
determine the next hop in the sequence
Connection oriented not often used

(using IP is dominant)
Connectionless Operation




Corresponds to datagram mechanism in packet
switched network
Each NPDU treated separately, and routed
from source DTE to destination DTE through a
series of routers and networks.
All DTEs and all routers share a common
network-layer protocol known generically as
the internet protocol
Internet Protocol



One such internet protocol developed for ARPANET
RFC 791 (Get it and study it)
Below the IP a lower layer protocol needed to
access particular network
Connectionless Internetworking


IP provides a connectionless, or datagram,
service between end systems. There are a
number of advantages to this approach:
Advantages




Flexibility
Robust
No unnecessary overhead
Unreliable


Not guaranteed delivery
Not guaranteed order of delivery


Packets can take different routes
Reliability is responsibility of next layer up (e.g. TCP)
IP Operation
Internet Protocol - IP
All Internet transport protocols use the
Internet Protocol (IP) to carry data from
source host to destination host.
35
IP Features


IP is a connectionless or datagram
internetwork service, providing no end-to-end
delivery guarantees.
IP datagrams may arrive at the destination
host damaged, duplicated, out of order, or not
at all.
36
IP Features



The layers above IP are responsible for
reliable delivery service when it is required.
The IP protocol includes provision for
addressing, type-of-service specification,
fragmentation and re-assembly, and security.
The datagram or connectionless nature of IP
is a fundamental and characteristic feature of
the Internet architecture.
37
Connectionless IP Internetworking

Advantages




Flexibility
Robust
No unnecessary overhead
Unreliable


Not guaranteed delivery
Not guaranteed order of delivery


Packets can take different routes
Reliability is responsibility of next layer up (e.g.
TCP)
38
IP
Operation
39
Router-based Networking
40
Internetworking Protocols
41
IP provides several services:





Addressing. IP headers contain 32-bit addresses which identify the
sending and receiving hosts. These addresses are used by intermediate
routers to select a path through the network for the packet.
Fragmentation. IP packets may be split, or fragmented, into smaller
packets. This permits a large packet to travel across a network which can
only handle smaller packets. IP fragments and reassembles packets
transparently.
Packet timeouts. Each IP packet contains a Time To Live (TTL) field,
which is decremented every time a router handles the packet. If TTL
reaches zero, the packet is discarded, preventing packets from running in
circles forever and flooding a network.
Type of Service. IP supports traffic prioritization by allowing packets to be
labeled with an abstract type of service.
Options. IP provides several optional features, allowing a packet's sender
to set requirements on the path it takes through the network (source
routing), trace the route a packet takes (record route), and label packets
with security features.
42
Internet Protocol Packet Header
43
VERS - Version


The version of the IP protocol. The current
version is 4.
5 is experimental and 6 is IPng (see IP: The
Next Generation (IPng)).
The version
of the IP
protocol
44
LEN - Length

The length of the IP header counted in 32-bit
quantities. This does not include the data
field.
The length
of the IP
header
45
Type of Service

The type of service is an indication of the
quality of service requested for this IP
datagram.
quality of
service??
46
Type of Service - Precedence

Is a measure of the nature and
priority of this datagram:








000 Routine
001 Priority
010 Immediate
011 Flash
100 Flash override
101 Critical
110 Internetwork control
111 Network control
47
TOS - Type Of Service







Specifies the type of
service value:
1000 Minimize delay
0100 Maximize throughput
0010 Maximize reliability
0001 Minimize monetary
cost
0000 Normal service
A detailed description of the type of
service can be found in the RFC
1349
48
MBZ - Must Be Zero

Reserved for
future use
("must be zero"
unless
participating in
an Internet
protocol
experiment
which makes
use of this bit)
49
Total Length



Total length of the IP datagram in bytes
Maximum size is 64k because there are 16
bits for it
That means a single IP datagram cannot be
bigger than 65536 bytes including the header
50
Fragmentation Related Information



The next 32 bits contain information related to
fragmentation
This information can be used to reassemble a
fragmented IP datagram
Fragmentation means that on its way a single IP
datagram was broken into smaller IP datagrams
because the intervening network was unable to carry
the original datagram because it was too big
51
Why Fragment?



When an IP datagram travels from one host to another, it
can cross different physical networks.
Physical networks have a maximum frame size, called the
Maximum Transmission Unit (MTU), which limits the length
of a datagram that can be placed in one physical frame.
Therefore, a scheme has been put in place to fragment
long IP datagrams into smaller ones, and to reassemble
them at the destination host.
IP requires that each link has an MTU of at least 68 bytes,
so if any network provides a lower value than this,
fragmentation and re-assembly must be implemented in
the network interface layer in a way that is transparent to
IP.
52
Why Fragment?
Host - A in LAN -1 is commnicating
with Host - B in LAN -2 using IP
Host - B
Host - A
LAN -1
Ethernet
MTU = 1500 bytes
Router
A
WAN -1
X.25
MTU = 128 bytes
Router
B
LAN - 2
Ethernet -2
MTU = 1500 bytes
Router A has to perform
fragmentation of IP datagrams
when forwarding them from
LAN-1 to WAN-1
53
Fragmentation Procedure

An unfragmented datagram has all-zero
fragmentation information. That is, the more
fragments flag bit is zero and the fragment
offset is zero. When fragmentation is to be
done, the following steps are performed:
54
Fragmentation Procedure


The DF flag bit is checked to see if
fragmentation is allowed. If the bit is set, the
datagram will be discarded and an error will
be returned to the originator using ICMP.
Based on the MTU value, the data field is
split into two or more parts. All newly created
data portions must have a length which is a
multiple of 8 bytes, with the exception of the
last data portion.
55
Fragmentation Procedure


Each of these fragmented datagrams is now
forwarded as a normal IP datagram.
IP handles each fragment independently, that
is, the fragments may traverse different
routers to the intended destination, and they
may be subject to further fragmentation if
they pass through networks that have smaller
MTUs.
56
Reassembley Procedure

At the destination host, the data has to be
reassembled into one datagram. The identification
field of the datagram was set by the sending host to a
unique number (for the source host, within the limits
imposed by the use of a 16-bit number). As
fragmentation doesn't alter this field, incoming
fragments at the receiving side can be identified, if this
ID field is used together with the Source and
Destination IP addresses in the datagram. The
Protocol field is also to be checked for this
identification.
57
Reassembley Procedure - 2

In order to reassemble the fragments, the receiving
host allocates a buffer in storage as soon as the first
fragment arrives. A timer routine is then started.
When the timer timeouts and not all of the fragments
have been received, the datagram is discarded. The
initial value of this timer is called the IP datagram
time-to-live (TTL) value. It is implementation
dependent, and some implementations allow it to b
configured; for example AIX Version 3.2 provides an
ipfragttl option with a default value of 60 seconds.
58
Re-assembly Procedure - 3

When subsequent fragments of the datagram
arrive, before the timer expires, the data is
simply copied into the buffer storage, at the
location indicated by the fragment offset field.
As soon as all fragments have arrived, the
complete original unfragmented datagram is
restored, and processing continues, just as
for unfragmented datagrams.
59
Fragmentation Fields


Identification - A unique number assigned by
the sender to aid in reassembling a
fragmented datagram. Fragments of a
datagram will have the same identification
number.
Fragment Offset - Used with fragmented
datagrams, to aid in reassembly of the full
datagram. The value is the number of 64-bit
pieces (header bytes are not counted) that are
contained in earlier fragments. In the first (or
only) fragment, this value is always zero.
60
Flags



Where:
0 Reserved, must be zero
DF Don't Fragment:



0 means
allow fragmentation
1 means do not allow
fragmentation
MF More Fragments: 0 means that this is the
last fragment of this datagram, 1 means that
this is not the last fragment.
61
Dealing with Failure in Re-assembly



Re-assembly may fail if some fragments get
lost
Need to detect failure
Re-assembly time out



Assigned to first fragment to arrive
If timeout expires before all fragments arrive,
discard partial data
Use packet lifetime (time to live in IP)

If time to live runs out, kill partial data
62
TTL - Time To Live

Specifies the time (in seconds) this
datagram is allowed to travel. Each
router where this datagram passes is
supposed to subtract from this field
its processing time for this datagram.
Actually a router is able to process a
datagram in less than 1 second; thus
it will subtract one from this field, and the
TTL becomes a hop-count metric rather than a time metric. When
the value reaches zero, it is assumed that this datagram has been
traveling in a closed loop and it is discarded. The initial value
should be set by the higher-level protocol which creates the
datagram.
63
Protocol- Protocol Number

Indicates the higher-level protocol to which IP should deliver the
data in this datagram. Some important values are:












0 Reserved
1 Internet Control Message Protocol (ICMP)
2 Internet Group Management Protocol (IGMP)
3 Gateway-to-Gateway Protocol (GGP)
4 IP (IP encapsulation)
5 Stream
6 Transmission Control (TCP)
8 Exterior Gateway Protocol (EGP)
9 Private Interior Routing Protocol
17 User Datagram (UDP)
89 Open Shortest Path First
The full list can be found in STD 2 - Assigned Internet Numbers.
64
Header Checksum

Is a checksum on the header only.
It does not include the data. The
checksum is calculated as the 16bit one's complement of the one's
complement sum of all 16-bit
words in the header. For the
purpose of this calculation, the
checksum field is assumed to be
zero. If the header checksum does
not match the contents, the
datagram is discarded because at
least one bit in the header is
corrupt, and the datagram may
even have arrived at the wrong
destination.
65
Options

Various options
regarding this
datagram, including
how to route it, how to
identify it (security
labeling), how to trace
the places through
which it passes, how to
time-stamp it for delay
measurement, etc.
•Security
•Source routing
•Route recording
•Timestamping
66
Options

Options – Up to 40 bytes of option data added by source host or
intermediate routers
 1 byte Option id, followed by an optional 1 byte Option length,
followed by Option data


Padded to a multiple of 4 bytes
5 options currently defined
 Security – Security identifier
 source routing – Complete route specified
 Record route – Each router appends its address to the list
 Timestamp – Each router appends address & timestamp
 stream id (used for voice) for stream line transmission
67
Updated Ipv4 Packet Header
DS (8 bits): This field supports the Differentiated Service function
ECN (2 bits): The Explicit Congestion Notification field, defined in RFC 3168, enables
routers to indicate to end nodes packets that are experiencing congestion, without the
necessity of immediately dropping such packets.
68
Type of Service Changed !
Originally defined as the Type of
Servicefield, this field is now
redefined .New technologies are
emerging that require real-time data
streaming and therefore will make
use of the DSCP field. An example is
Voice over IP (VoIP) that is used for
interactive data voice exchange.
quality of
service??
Type of Service Changed !
DS (8 bits): This field supports the Differentiated Service function
• Differentiated Services or DiffServ is a computer networking
architecture that specifies a simple, scalable and coarse-grained
mechanism for classifying, managing network traffic and providing
Quality of Service (QoS) guarantees on modern IP networks. DiffServ
can, for example, be used to provide low-latency to critical network
traffic such as voice or video while providing simple best-effort traffic
guarantees to non-critical services such as web traffic or file transfers.
• DiffServ uses the 6-bit Differentiated Services Code Point (DSCP) field
in the header of IP packets for packet classification purposes. DSCP
replaces the outdated IP precedence, a 3-bit field in the Type of Service
byte of the IP header originally used to classify and prioritize types of
traffic.
Type of Service Changed !
ECN (2 bits): The Explicit Congestion Notification field, defined in RFC
3168, enables routers to indicate to end nodes packets that are
experiencing congestion, without the necessity of immediately dropping
such packets.
A value of 00 indicates a packet that is not using ECN. A value of 01 or
10 is set by the data sender to indicate that the end-points of the
transport protocol are ECN-capable. A value of 11 is set by a router to
indicate congestion has been encountered.
72