0% found this document useful (0 votes)
2 views131 pages

Networks and Security Lecture Notes 1

The document outlines the syllabus for a course on network models and the data link layer, covering topics such as network attributes, OSI and TCP/IP models, and error detection protocols. It explains the components of a computer network, including personal computers, switches, and routers, and highlights common user applications like email and web browsers. Additionally, it details the functions of various OSI layers, emphasizing their roles in data transmission and network communication.

Uploaded by

Joe Clement
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views131 pages

Networks and Security Lecture Notes 1

The document outlines the syllabus for a course on network models and the data link layer, covering topics such as network attributes, OSI and TCP/IP models, and error detection protocols. It explains the components of a computer network, including personal computers, switches, and routers, and highlights common user applications like email and web browsers. Additionally, it details the functions of various OSI layers, emphasizing their roles in data transmission and network communication.

Uploaded by

Joe Clement
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 131

<br>

Page 1 of 131

UNITI
NETWORK MODELS AND DATALINK LAYER
SYLLABUS:

Overview of Networks and its Attributes Network Models - OSI, TCP/IP, Addressing
-
Introduction to Data link Layer Error Detection and Correction Ethernet(802.3)- Wireless
LAN – IEEE 802.11,Bluetooth - Flow and Error Control Protocols - HDLC - PPP.

Buildinga network:

g
in
A computer network or data network is a telecommunications network which allows computers to
exchange data. In computer networks, networked computing devices pass data to each other along

er
network links (data connections).

e
Data is transferred in the form of packets. The connections between nodes are established using either

in
cable media or wireless media. The best known computer network is the Internet.
To build a computer network is defining what a network is and understanding how it is used to helpa

ng
business meet its objectives. A network is a connected collection of devices and end systems, such as
computers and servers, which can communicate with each other.
fE
These are the four major categories of physical components in a computer network:
Personal computers (PCs): The PCs serve as endpoints in the network, sending and receiving
O
data.
Interconnections: The interconnections consist of components that provide a means for data to
e

travel from one point to another point in the network.


g

This category includes components such as the following:


Network interface cards (NICs) that translate the data produced by the computer into a
le

format that can be transmitted over the local network.


ol

Network media, such as cables or wireless media, that provides the means by which the
C

signals are transmitted from one networked device to another.


Connectors that provide the connection points for the media.
u

Switches: Switches are devices that provide network attachment to the end systems and intelligent
ad

switching of the data within the local network.


Routers: Routers interconnect networks and choose the best paths between networks.
iln

Network User Applications: The key to utilizing multiple resources on a data network is having
m

applications that are aware of these communication mechanisms. Although many applications are
available for users in a network environment, some applications are common to nearly all users.
Ta

The most common network user applications include the following:

E-mail: E-mailis a valuable application for most network users. Users can communicatee
information (messages and files) electronically in a timely manner, to not only other users in the
same network but also other users outside the network (suppliers, information resources, and

1
<br>

Page 2 of 131

customers, for example). Examples of e-mail programs include Microsoft Outlook and Eudora by
Qualcomm.

Web browser: A web browser enables access to the Internet through a common interface. The
Internet provides a wealth of information and has become vital to the productivity of both home
and business users. Communicating with suppliers and customers, handling orders and fulfillment,
and locating information are now routinely done electronically over the Internet, which saves time
and increases overall productivity. The most commonly used browsers are Microsoft Internet
Explorer, Netscape Navigator, Mozilla, and Firefox.

g
Instant messaging : Instant mnessaging started in the personal user-to-user space;• however, it

in
soon provided considerable benefit in the corporate world. Now many instant messaging

er
applications, such as those provided by AOL and Yahoo!, provide data encryption and logging.
features essential for corporate use.

e
in
Collaboration: Working together as individuals or groups is greatly facilitated when the

ng
collaborators are on a network. Individuals creating separate parts of an annual report or a business
plan, for example, can either transmit their data files to a central resource for compilation or use a
workgroup software application to create and modify the entire document, without any exchange
fE
of paper. One of the best-known traditional collaboration software programs is Lotus Notes. A
more modern web-based collaboration application is a wiki.
O

Database: This type of application enables users on a network to store information ine central
e

locations (such as storage devices) so that others on the network can easily retrieve selected
g

information in the formats that are most useful to them. Some of the most common databases used
le

in enterprises today are Oracle and Microsoft SQL Server.


ol
C

Requirements:
u

An application programmer would list the services that his or her application needs- -for example, a
ad

guarantee that each message the application sends will be delivered without error within a certain amount
of time or the ability to switch gracefully among different connections to the network as the user moves
iln

around.
m

A network operator would list the characteristics that is easy to administere and manage
of a system
Ta

for example, in which faults can be easily isolated, new devices can be added to the network and
configured correctly. and it is easy to account for usage.

A network designer would list the properties of a cost-effective designfor example, that network
resources are efficiently utilized and fairly allocated to different users. Issues of performance are also
likely to be important. This section attempts to distill these different perspectives into a high-level.

2
<br>

Page 3 of 131

Layering and protocols:


OSI Architecture: ISO defines a common way to connect computer by the architecture called Open
System Interconnection(OSI) architecture.

Network functionality is divided into seven layers.

7 Application
Sender

-- Receiver

g
in
6 Presentation

er
The letter is written, The letter is picked up.
put in an envelope, and Higher layers removed from the

e
5 Session dropped in a mailbox. envelope, and read.

in
ng
Transport The letter is carried The letter is carried
from the mailbox Middle layers from the post office
to a post office. to the mailbox.

3 Network fE
The letter is delivered The letter is delivered
O
to a carrier by the post Lower layers from the carrier
2 Data link office. to the post office.
g e

Physical The parcel is carried from


the source to the destination.
le
ol
C
u
ad
iln
m
Ta

Summary of layer functions

3
<br>

Page 4 of 131

To allow access to network


Application
resources
To translate, encrypt, and
compress data Presentation
To establish, manage, and
Session
terminate sessions
To provide reliable process-to
process message delivery and Transport
error recovery To move packets from source
Network to destination; to provide

g
internetworking
To organize bitsinto frames;

in
Data link
to provide hop-to-hop delivery
To transmit bits over a medium;

er
Physical to provide mechanical and
electrical specifications

e
in
ng
:
Organization of the layers

The 7 layers can be grouped into 3 subgroups fE


1. Network Support Layers
O
Layers 1,2,3 - Physical, Data link and Network are the network support layers. They deal with the physical
e

aspects of moving data from one device to another such as electrical specifications, physical addressing, transport
g

timing and reliability.


le

2. Transport Layer:
ol

Layer4, transport layer, ensures end-to-end reliable data transmission ona single link.
C

3. User Support Layers


u

Layers 5,6,7 -Session, presentation and application are the user support layers.They allow Interoperability
ad

among unrelated software systems.


iln
m
Ta

An Data exchange using the OSI model:

4
<br>

Page 5 of 131

H7 D7 H7
D7
H6 D6 D6

HS D5 DS

|H4 D4 D4

g
H3 D3 H3 D3

in
H2 D2 T2 D2

er
o1o 010101010101101010000010000 o10 010101010101101010000010000

e
Transmission medium

in
ng
Functions of the Layers
1. Phvsical Laver: fE
The physical layer coordinates the functions required to transmit a bit stream over a physical medium.
O
From data link layer To data link layer
g e
le

Physical Physical
layer 110 10101000000010111 110 10101000000010111 layer
ol
C

Transmission medium
u
ad

The physical layer is concerned with the following:


iln

-
Physical characteristics of interfaces and media The physical layer defines the characteristics of the
m

interface between the devices and the transmission medium.


* Representation of bits - To transmit the stream of bits, it must be encoded to signals. The physical layer
Ta

defines the type of encoding.


* Data Rate or Transmission rate - The number of bits sent each second is also defined by the physical -
layer.
-
Synchronization of bits The sender and receiver must be synchronized at the bit level Their clocks must
be synchronized.
Line Configuration - In a point-to-point configuration, two devices are connected togetherthrough a
dedicated link. In a multipoint configuration, a link is shared between several devices.
5
<br>

Page 6 of 131

-
$ Physical Topology The physical topology defines how devices are connected to make a network.
Devices can be connected using a mesh, bus, star or ring topology.
Transmission Mode - The physical layer also defines the direction of transmission– between two
devices: simplex, half-duplex or full-duplex.
2. Data Link Laver

It is responsible for transmitting frames from one node to next node.

Relationship of the Data link layer to the Network and Physical layer:

g
From network layer

in
To network layer
L3 data L3 data

er
Data Frame Pata
Iink Frame

e
layer T2 link
H2 T2 H2 layer

in
ng
10101000000010 10101000000010
To physical layer fEFrom physical layer
The other responsibilities of this layer are :
O
Framing - Divides the stream of bits received into data units called frames.
e

* Physical addressing - If frames are to be distributed to different systems on the n/w, data link layer adds
g

a header to the frame to define the sender and receiver.


le

Flow control- If the rate at which the data are absorbed by the receiver is less than the rate produced in
the sender ,the Data link layer imposes a flow ctrl mechanism.
ol

* -
Error control- Used for detecting and retransmitting damaged or lost frames and to prevent duplication
C

of frames. This is achieved through a trailer added at the end of the frame.
Access control -Used to determine which device has control over the link at any given time.
u
ad

3. NETWORK LAYER

It is mainly required, when it is necessary to send information from one network to another.
iln

Relationship of the Network layer to the Transport and Data link layer:
m
Ta

6
<br>

Page 7 of 131

From transport layer To transport layer


L4 data LAdata

Network Network Packet


layer Packet layer
H3 H3

g
L3 data L3 data

in
To data link layer From data link layer

er
The other responsibilities of this layer are :

e
Logical addressing - Ifa packet passes the n/w boundary, we need another addressing system for source

in
and destination called logical address.

ng
$ Routing- The devices which connects various networks called routers are responsible for delivering
packets to final destination.

4. TRANSPORT LAYER
fE
O
It is responsible for Process to Process delivery. It also ensures whether the message arrives in order or
not.
g e

From session layer To session layer


le

L5 data L5 data
ol

Transpoft Transpor
C

layer H4layer
H4 H4 H4 H4 H4
u
ad

L4 data L4 data
L4 data L4data
iln

L4 data L4 data
To network layer From network layer
m

Port addressing- The header in this must therefore include a address calledport address. This layer gets
Ta

the entire message to the correct process on that computer.


* Segmentation and reassembly - The message is divided into segments and each segment is assigned a
sequence number. These numbers are arranged correctly on the arrival side by this layer.
Connection control - This can either be connectionless or connection-oriented. The connectionless treats
each segment as a individual packet and delivers to the destination. The connection-oriented makes
connection on the destination side before the delivery. After the delivery the termination will be
terminated.
7
<br>

Page 8 of 131

* Flow and error control - Similar to data link layer, but process to process take place.

Transport layer (example)

Data k Transport Transport jk


layer layer Data
P
Data-2jkA
Network

g
P
P Network Data-1ikA
Data-l JTkA layer
AP

in
layer Data-2] j k
Data link

er
Data-2|l i kAP layer Data link A P
layer Data-1||i k
Data-1ikAP

e
P
Data-2jkA

in
ng
5.
SESSION LAYER fE
This layer establishes, manages and terminates connections between applications.
O
Relationship of the session layer to the transport and presentation layer:
e

From presentation layer To presentation layer


g

L6 data L6 data
le
ol

Session Session
C

layer layer)
H5 H5
u

syn syn syn syn syn


ad
iln

L5 data L5 data
To transport layer From transport
m

layer

The other responsibilities of this layer are


Ta

Dialog control - This session allows two systems to enter into a dialog either in half duplex or full
duplex.
Synchronization-This allows to add checkpoints into a stream of data.

6. PRESENTA TION LAYER


<br>

Page 9 of 131

It is concerned with the syntax and semantics of information exchanged between twO systems.

Relationship of the presentation layer to the application and session layers:

From application layer To application layer


L7 data L7 data

Presentation Presentation
layer
Encoded, encrypted, and
layer Decoded, decrypted, and
compressed data H6 decompressed data H6

g
in
er
L6 data L6 data
To session layer From session layer

e
The other responsibilities of this layer are:

in
Translation - Different computers use different encoding system, this layer is responsible for

ng
*
interoperability between thesee different encoding methods. It will change the message into some common
format. fE
Encryption and decryption-It means that sender transforms the original information to another form
and sends the resulting message over the n/w. and vice versa.
O
Compression and expansion-Compression reduces the number of bits contained in the information
particularly in text, audio and video.
g e

7. APPLICATION LAYER
le

This layer enables the user to access the nw. This allows the user to log on to remote user.
ol

Relationship of the application layer to the user and the presentation layer:
C

User User 4
u
ad

Application Application
layer layer
X.500 FTAM X.400 X.500 FTAM X.400
iln
m
Ta

L7data L7 data
To presentation layer From presentation layer

The other responsibilities of this layer are :

FTAM(file transfer,access,mgmt) - Allows user to access files in a remote host.


Mail services - Provides email forwarding and storage.
9
<br>

Page 10 of 131

Directory services - Provides database sources to access information about various sources and objects.

The interaction between layers in the OSI


Device Device
A B

Intermnediate Intermediate
node node

Peer-to-peer protocol (7th layer)


Application Application
7-6 interface 7-6 interface
Peer-to-peer protocol (6th layer)
6 Presentation Presentation 6
6-5 interface 6-5 interface

g
Peer-to-peer protocol (5th layer)
Session Session

in
S4 interface 5-4 interface
Peer-to-peer protocol (4th layer)
A Transport Transport

er
4-3 interface 4-3 interface
3rd 3rd
Network Network Network Network
3-2 interface 3-2 interface

e
2 Data link 2nd Data link 2nd Data link 2nd Data link

in
2-1 interface 2-1 interface
1 Physical 1st Physical
1st
Physical
1st
Physical

ng
Physical communication
model

Internet Architecture: fE
The Internet architecture, which is also sometimes called the TCP/IP architecture after its two main
O
protocols,TCP/IP& UDP.
The Internet architecture evolved out of experiences with an earlier packet-switched network called the
e

ARPANET. Both the Internet and the ARPANET were funded by the Advanced Research Projects
g

Agency (ARPA), one of the research and development funding agencies of the U.S. Department of
le

Defense.
The Internet and ARPANET were around before the OSI architecture, and the experience gained from
ol

*
building them was a major influence on the OSI reference model. Internet architecture is by definition a
C

meta-network, a constantly changing collection of thousands of individual networks intercommunicating


with a common protocol.
u

The Internet's architecture is described in its name, a short from of the compound word "inter
ad

networking". This architecture is based in the very specification of the standard TCP/IP protocol, designed
to connect any two networks which may be very different in internal hardware, software, and technical
iln

design.
Once two networks are interconnected, communication with TCP/IP is enabled end-to-end, so that any
m

node on the Internet has the near magical ability to communicate with any other no matter where they are.
This openness of design has enabled the Internet architecture to grow to a global scale.
Ta

TCP/IP was developed prior to the OSI model. It is developed with four layers:
Host-to-network layer (Physical & data link)
V Internet layer (network)
Transport layer (Part of session & Transport)
Application layer (Session, Presentation & Application)
TCPIP and OSI model
10
<br>

Page 11 of 131

Application Applications

Presentation SMTP FTP HTTP DNS SNMP TELNET

Session

Transport SCTP TCP UDP

g
ICMP IGMP

in
Network IP
(internet)

er
RARP ARP

e
in
Data link
Protocols defined by

ng
the underlying networks
Physical (host-to-network)

1.Host-t0-network layer
fE
O
It does not define any specific protocol. It supports all the standard and proprietary protocols. A network
in a TCP/IP internetwork can be a LAN or a WAN.
g e

2.Internet layer (network)


le

TCP/IP supports the Internetworking Protocol. IP, uses four supporting protocols:ARP,RARP, ICMP, and
ol

IGMP
C

Internetworking Protocol (IP)


u

The IP is the transmission mechanism used by the TCP/IP protocols. It is an unreliable and
ad

connectionless protocol-a best-effort delivery service.


The term best effort means -IP assumes the unreliability of the underlying layers and does its best
iln

to get a transmission through to its destination


* IP transports data in packets called datagrams, each of which is transported separately. Datagrams
m

can travel along different routes and can arrive out of sequence
Ta

Address Resolution Protocol:


ARP is used to find the physical address of the node when its Internet address is known.
Reverse Address Resolution Protocol:
The RARP allows a host to discover its Internet address when it knows only its physical address.

Internet Control Message Protocol

11
<br>

Page 12 of 131

$ The ICMP is a mechanism used by hosts and gateways to send notification of datagram problems
back to the sender. ICMP sends query and error reporting messages.
Internet Group Message Protocol:
$ The IGMP is used to facilitate the simutaneous transmission of a message to a group of recipients.
3.Transport layer (Part of session & Transport)
The transport layer was represented in TCP/IP by two protocols: TCP and UDP.UDP and TCP are
transport level protocols responsible for delivery of a message from a process to another process
User Datagram Protocol

g
The UDP is the simpler of the two standard TCP/IP transport protocols. It is a process-to

in
process protocol that adds only port addresses, checksum error control, and length information to the data
from the upper layer.

er
Transmission Control Protocol

e
TCP divides a stream of data into smaller units called segments. Each segment includes a sequence

in
number for reordering after receipt, together with an acknowledgment number for the segments received.
Segments are carried across the internet inside of IP datagram.

ng
Stream Control Transmission Protocol
The SCTP provides support for newer applications such as voice over the Internet. It is a
fE
transport layer protocol that combines the best features of UDP and TCP.

4.Application layer (Session, Presentation & Application)


O
The application layer in TCPIIP is equivalent to the combined session, presentation, and application layers
e

in the OSI model.


g
le

Network software:
ol

Networking software, in the most basic sense, is software that facilitates, enhances or interacts
with a computer network. One type of networking software allows computers to communicate with
C

one another, while another type of networking software provides users access to shared programs.
Networking software is a key component of today's computer networks, including the Internet.
u

Understanding the types of networking software is the first step in understanding how your
ad

computer network really works.


iln

Performance:
m

Network performance is measured in two fundamental ways: bandwidth (also called throughput) and
latency (also called delay). The bandwidth of a network is given by the number of bits that can be
Ta

transmitted over the network in a certain period of time. Bandwidth and throughput are two of the most
confusing terms used in networking.
* Latency = Propagation+Transmit+Queue +Processing Propagation = Distance/SpeedOfLight Transmit =
Size/Bandwidth

12
<br>

Page 13 of 131

Network delay is an important design and performance characteristic of a computer network; it specifies how
long it takes for a bit of data to travel across the network from one node to another. It is typically measured in
multiples or fractions of seconds.

Network engineers divide the delay into several parts:

Propagation delay - time for a signal to reach its destination


Processing delay - time routers take to process the packet header
Queuing delay - time the packet spends in routing queues
Transmission delay - time it takes to push the packet's bits onto the link

g
Thus, we can calculate the total delay of a network using the following formula:

in
Delay (or latency) = propagation delay + transmission delay

er
+ processing delay + queuing delay.

e
in
Link layer Services:

ng
The main task of the data link layer is that it transfers data from the network layer of one machine to the
network layer of another machine. This is a part of the services it gives to the upper layer. If you
fE
remember, above the data link layer, we have the network layer.
The data link layer gives a service to the network layer, and this service is the transfer of data from one
O
network layer to the other, and this in turn uses the physical layer. It converts the raw bit stream of the
physical layer into groups of bits or frames.
e

DLL offers unacknowledged connectionless and acknowledged connectionless services.


g

In unacknowledged connectionless, there is no attempt to recover lost frame and there is no


le

acknowledgement from the other side. It is suited for low error rate networks or for fault tolerant
applications such as voice. By voice tolerant application, we mean that even if some of the bits in a
ol

digitized voice stream drop, there will be some degradation on the other side. But to the human ear, it is
C

imperceptible. That is why it is fault-tolerant.


In acknowledged connectionless service, each frame is acknowledged by the receiver and it is suited for
u

unreliable channels, where acknowledgement is required for special reliability.Acknowledged connection


ad

oriented service ensures that all frames are received and each is received exactly once and these services
are accomplished using simplex not the usual, but half-duplex or full-duplex channels. These are some
iln

examples. It is a reliable message stream. It may be connection-oriented service or connectionless service.


It may be a reliable message stream (sequence of pages) or reliable byte stream (reliable login): in the
m

latter it is coming byte by byte and in the former, it is page by page.


* An example of unreliable connection is digitized voice; unreliable datagram (electronic junk mail) is
Ta

connectionless `service.

Framing:
13
<br>

Page 14 of 131

To transmit frames over the node it is necessary to mention start and end of each frame. There are three
techniques to solve this frame

1. Byte-Oriented Protocols (BISYNC, PPP, DDCMP)

2. Bit-Oriented Protocols (HDLC)

3. Clock-Based Framing (SONET)

1.
Byte Oriented protocols:

In this, view each frame as a collection of bytes (characters) rather than a collection of bits. Such

g
a byte

in
oriented approach is exemplified by the BISYNC (Binary Synchronous Communication) protocol and the
DDCMP (Digital Data Communication Message Protocol)

er
Sentinel Approach: (a) BISYNC (Binary Synchronous Communication) : The BISYNC protocol illustrates

e
the sentinel approach toframing:; its frame format is

in
8 16

ng
¿Hondor Body
4CRC
fE
The beginning of a frame is denoted by sending a special SYN (synchronization) character.
O
The data portion of the frame is then contained between special sentinel characters: STX (start of text) and
ETX (end of text).
The SOH (start of header) field serves much the same purpose as the STX field. The frame format also
e

includes a field labeled CRC (cyclic redundancy check) that is used to detect transmission errors.
g

The problem with the sentinel approach is that the ETX character might appear in the data portion of the
le

frame.
ol

BISYNCovercomes this problem by -escaping the ETX character by preceding it with a DLE (data
link-escape)character whenever it appears in the body of a frame; the DLE character is also escaped (by
C

preceding it with an extra DLE) in the frame body. This approach is called character stuffing.
u
ad

(b) Point-to-Point Protocol (PPP):

The more recent Point-to-Point Protocol (PPP). The format of PPP frame is
iln
m

16 16
Ta

Flag| Address Control Protocol Paylod Checdsum Flag


|

PPP Frame Format

14
<br>

Page 15 of 131

The Flag field has 01111110as starting sequence.


The Address and Control fields usually contain default values.
The Protocol field is used for demultiplexing.
The frame payload size can he negotiated, but it is 1500 bytes by default.
The PPP frame format is unusual in that several of the field sizes are negotiated rather than fixed.
Negotiation is conducted by a protocol called LCP (Link Control Protocol).LCP sends control messages
encapsulated in PPP frame such messages are denoted by an LCP identifier in the PPP Protocol.

(c)Byte-Counting Approach: DDCMP(Digital Data Communication Message Protoco)

g
The number of bytes contained in a frame can he included as a field in the frame header. DDCMP

in
protocol is used for this approach. The frame format is

er
8 8 14 42 J6

e
SYN SYN Class

in
Count Header Body CRC

ng
DDCMP frame fomat
fE
COUNT Field specifies how many bytes are contained in the frame's body. Sometime count field will be
corrupted during transmission, so the receiver will accumulate as many bytes as the COUNT field
O
indicates. This is sometimes calleda framing error. The receiver will then wait until it sees the next SYN
e

character.
g

2. Bit-Oriented Protocols (HDLC)


le

In this, frames are viewed as collection of bits. High level data link protocol is used. The format is
ol

8 16 16
Beginning Header Ending
C

sequence Body 4CRC sequence


Fig: HDLC Frame For
u

HDLCdenotes both the beginning and the end of a frame with the distinguished bit sequence 011 111 10.
ad

This sequence might appear anywhere in the body of the frame, it can be avoided by bit stuffing.
On the sending side, any time five consecutive l's have been transmitted from the body of the message (i.e.,
excluding when the sender is trying to transmit the distinguished 01111110 sequence), the sender inserts a 0 before
iln

transmitting the next bit.


On the receiving side, five consecutive 1's arrived, the receiver makes its decision based on the next bit it sees (i.e.,
m

the bit following the five is).


If the next bit is a 0, it must have been stuffed, and so the receiver removes it. If the next bit is a 1, then one of two
Ta

things is true, either this is the end-of-frame marker or an error has been introduced into the bit stream.
By looking at the next bit, the receiver can distinguish between these two cases:
If it sees a 0 (i.e., the last eight bits it has looked at are 01111110), then it is the end-of- frame marker.
If it sees a 1 (i.e., the last eight bits it has looked at are 01111111), then there must have been an error and the whole
frame is discarded.
3. Clock-Based Framing

$ (SONET) Synchronous Optical Network Standard is used for long distance transmission of data over
optical network. It supports multiplexing of several low speed links into one high speed links.
15
<br>

Page 16 of 131

An STS-1 frame is used in this method.


Overhead e Payload

9 rows

g
in
90 columns

It is arranged as nine rows of 90 bytes each, and the first 3 bytes each row are overhead, with the rest

er
of

being available for data.

e
The first 2 bytes of the frame contain a special bit pattern, and it is these bytes that enable the receiver to

in
determine where the frame starts.
The receiver looks for the special bit pattern consistently, once in every 810 bytes, since each frame is 9 x

ng
90 = 810 bytes long.

STS-1 STS-1
fE Hdr
STS-1
O
g e

Hdr STS-3C
le
ol

The STS-N frame can he thought of as consisting of N STS-1 frames, where the bytes from these frames
C

are interleaved; that is, a byte from the first frame is transmitted, then a byte from the second frame is
transmitted, and so on.
u

Payload from these STS-1 frames can he linked together to form a larger STS-N payload,¬ such a link is
ad

denoted STS-Nc. One of the bit in overhead is used for this purpose.
iln

Error Detection and Correction:


Data can be corrupted during transmission. For reliable communication, errors must be detected and
m

corrected.
Ta

Types of Errors :

1.Single-bit error

2. Burst Error

Single-bit error

16
<br>

Page 17 of 131

The term Single-bit error means that only one bit of a given data unit (such as byte, character, data unit or
packet) is changed from 1 to 0 or from 0 to 1.

0 changed to 1

ooooio10oooooo10
Received Sent

Burst Error

g
The term Burst Error means that two or more bits in the data unit have changed from 1
to 0 or from 0 to 1.

in
Length of burst
error (5 bits)

er
Sent
O||oo|o|1|0lo [o|1|o|o|o|oI|]

e
Bits corrupted by burst error

in
o1|0TiIIoi|o|1|OooTo|1||
Received

ng
Redundancy:
fE
One method is to send every data twice, so that receiver checks every bit of two copies and detect error.

Drawbacks
O
Sends n-redundant bits for n-bit message.
e

Many errors are undetected if both the copies are corrupted.


g
le

Instead of adding entire data, some bits are appended to each unit. This is called redundant bit because
the bits added will not give any new information. These bits are called error detecting codes.
ol

The three error detecting techniques are:


C

* Parity check
u

3 Check sum algorithm


ad

Cyclic Redundancy Check

Parity Check
iln

Simple parity check


m

Only one redundant bit, called parity bit is added to every data unit so that the total number of l's in unit become
Ta

even (or odd)

TwoDimensional Parity

It is based on simple parity. It performs calculation for each bit position across each byte in the frame. This adds
extra parity byte for entire frame, in addition to a parity bit for each byte.

17
<br>

Page 18 of 131

Parity
bits
O1010011
1101001o
1011110 1

Data
0001110
Two-dimensional parity
01101001
10111110

g
in
Parity
byte 1111011o

er
For example frame containing 6 bytes of data. In this third bit of the parity byte is I since there are an odd

e
number of l's is in the third bit across the 6 bytes in the frame. In this case, 14 bits of redundant information are

in
added with original information.

ng
Check sum algorithm:
fE
* In the sender side all the words are added and then transmit the result of sum called checksum with the
data. The receiver performs the same calculation on the received data and compares the result with the
O
received checksum.
* If any transmitted data, including the checksum itself, is corrupted, then the results will not match, so the
receiver knows that an error occurred. Instead of sending the checksum as such, one's complement of
e

that sum will be send to the receiver.


g

If the receiver gets the result as zero then it will be the correct one. In this, we can represent unsigned
le

number from 0 to 2" using n bits.


ol

If the number has more than n bits, the extra leftmost bits need to be added to the n rightmost bits. Data
can be divided in to 16 bit word and the Checksum is initialized to zero.
C
u
ad
iln
m
Ta

18
<br>

Page 19 of 131

Sender
Receiver
5 7
9
5
Sum 21
Check Sum

Sum 30
Check Sum
1010
o

g
in
1
1111 0

er
6 0110

e
1001

in
15 1111

ng
0000

Cyclic Redundancy Check :


fE
O
* It uses small number of redundant bits to detect errors.
Divisor is calculated by the polynomial functions under two conditions.
e

a. It should not be divisible by x


g

b. It should be divisible by x+1


Consider the original message as M(x) –n+1 bits
le

Divisor C(x) –K bits


ol

Original sent message = M(x) + k-1 bits


C
u
ad

00..0| Data CRC Data


n bits
iln
m

Divisor n+l bits CRC| Data Divisor


Remainder
Ta

CRCn bits Remainder


Zero, accept
Non-zero, reject
Sender Receiver

19
<br>

Page 20 of 131

:
Steps

* Append k-1 zeros with M(x)– P(x)


Divide P(x) by C(x)
Subtract the remainder from T(x)
Subtraction is made by making XOR operation

Eg: 100100 by 1101

Quotient
1
11 1 0 1

g
Data plus

in
o
Divisor 1 1 0 1
) 1 0 0 1 0
o00 extra zeros

er
1 1 0 1

1
00 0

e
1
10 1

in
ng
1
0 1
0
1
1
10
1110
fE 1
1
10
O
When the leftmost bit 0 1 1
0
of the remainder is zero,
e

we must use 0000 instead 000 0


g

of the original divisor. 1 1 0


0
le

1
10 1
ol

( |0 0 1
Remainder
C

Error Correction:
u
ad

Error Correction can be handled in two ways

When an error is discovered, the receiver can have the sender to retransmit the entire data
iln

1. unit.

2. A receiver can use an error correcting code, which automatically correct certain errors.
m

Error correcting codes are more sophisticated than error-detection codes and require more redundancy
Ta

bits.

In single bit error detection only two states are sufficient.

1) error

2) no error

20
<br>

Page 21 of 131

Two states are not enough to detect an error but not to correct it.

Redundancy Bits:
To calculate the number of redundancy bit(r) required to correct a given number of data bits (m), we must
find a relationship between m and r.
Add m bits of data with r bits. The length of the resulting code is m+r.

g
Data and Redundancy bits
Redundancy

in
Data(nn) bits () bits

e er
in
Total m

+rbits

ng
fE
If the total number of bitsare m+r, then r must be able to indicate at least m+r+1 different states. r bits can
indicate 2" different states. Therefore, 2° must be equal to or greater than m+r+1
O
m

2> +rt1
g e
le
ol
C
u
ad
iln
m
Ta

21
<br>

Page 22 of 131

Relationship between data and redundancy bits

Number of Data Number of redundancy Total bits (mtr)


Bits (m) Bits(r)
1
2 3
2 3 5
3 3 6

g
4 3 7

in
5 4 9

er
6 4 10

e
4 11

in
ng
Hamming Code:
R.W. Hamming provides a practical solution for the error correction.
fE
Positioning the Redundancy Bits
O
For example, a seven-bit ASCIl code requires four redundancy bits that can be added to the end of the
data or intersperse with the original data bits. These redundancy bits are placed in positions 1, 2, 4 and 8. We refer
e

these bits as rl, r2, r3 and r4


g
le
ol
C
u

Position of redundancy bits in Hamming code


ad

11 10 9 8 7 6 5 4 3 2 1

dd rd rr
iln

dd |drd
m
Ta

Redundancy bits

The combination used to calculate each of the four r values for a seven-bit data sequence are as follows

22
<br>

Page 23 of 131

* The rl bit is calculated using all bits positions whose binary representation include a in the rightmost 1

position.
r2 is calculated using all bit position with a l in the second position and so on rl:bits 1,3,5,7,9, 1 1

$ r2: bits 2,3, 6, 7, 10, 11


r3: bits 4, 5, 6, 7
r4: bits 8, 9, 10, 11

Redundancy bits calculation


riofwill take care

g
the se bits

in
101| 1001 O01 1

er
O101 O001
11 7 5 3 1

d d dd d
d

e
2
r4

in
r2of will take care

ng
the se bits

101| 1O10 fE OO1 1


O010
10 6 2
d d d d r4 d r2
O
r4 will take care
e

of these bits
g
le

o11 101100101 0T00


7 6 5 4
ol

dd d r8 d d d r4 d r2
C
u

rg willtake care
ad

of these bits
iln

101110101001 1000
11 10 9 8
m

dd d r8 ddd r4 d r2
Ta

Calculating the r values


> Place each bit of the original character in its appropriate position in the l1-bit unit.
23
<br>

Page 24 of 131

A Calculate the even parities for the various bit combination.


The parity value for each combination is the value of the corresponding r bit.

For example,
> The value rl is calculated to provide even parity for a combination of bits 3,5,7,9 and 11.
of
> The value of r2 is calculated to provide even parity with bits 3, 6, 7, 10 and 11.
The value of r3 is calculated to provide even parity with bits 4,5,6 and 7.
> The value of r4 is calculated to provide even parity with bits 8,9,10 and 11.

g
Data: 1001I01

in
Data 1o0 11o 1

e er
Adding ri

in
ng
Adding rz 1|0|
o 1

fE
Adding r4 1
0
O
e

Adding r8 OO|0TIT100TI
O
g
le
ol

1
Code: 00i1100101
C

Error Detection and Correction :


u

Now imagine the received data has 7th bit changed from 1 to 0.
ad

Single-bit error
iln

Sent Received
Ioo1Ioo1o1oo10oo10
m
Ta

Error
The receiver takes the transmission and recalculates four new data using the same set of bits used by the
sender plus the relevant parity (r) bit for each set.

24
<br>

Page 25 of 131

Error detection

11 10 9 8 7 6 5 4 3 2

II I0 9 8 7 6 5 4 2

1
10 9 8
7 6 5 4 3 2

g
in
11 10 9 8 7 6 5 4 3

e er
in
The bit in position
is in error.

ng
fE
Then it assembles the new parity values into a binary number in order of r position (r8,r4,r2,rl ).
This step gives us the binary number 0111(7 in decimal) which is the precise location of the bit in error.
O
Once the bit is identified, the receiver can reverse its value and correct the error.
e

Hamming Distance:
g
le

One of the central concepts in coding for error control is the idea of the Hamming distance.
ol

The Hamming distance between two words (of the same size) is the number of differences
C

between the corresponding bits. The Hamming distance between two words x and y is d(x, y).
The Hamming distance can be found by applying the XOR operation on the two words and count
u

the number of 1 's in the result.


ad

In a set of words, the minimum Hamming distance is the smallest Hamming distance between all
possible pairs. We use dmin to define the minimum Hamming distance in a coding scheme.
iln
m
Ta

Flow control:
25
<br>

Page 26 of 131

Flow control is the management of data flow between computers or devices or between nodes in a
network so that the data can be handled at an efficient pace.
Too much data arriving before a device can handle it causes data overflow, meaning the data is either lost
or must be retransmitted.
For serial data transmission locally or in a network, the Xon/Xoff protocol can be used. For modem
connections, either Xon/Xoff or CTS/RTS (Clear to Send/Ready to Send) commands can be used to
control data flow.
Any time an error is detected in an exchange, specified frames are retransmitted. This process is called
automatic repeat request (ARQ).

g
PROTOCOLS:

in
The protocols are normally implemented in software by using one of the common programming
languages.

er
Protocols

e
in
For noiseless For noisy
channel

ng
channel

Simplest Stop-and-Wait ARQ


Stop-and-Wait fE Go-Back-N ARQ
Selective Repeat ARQ
O
The data frames travel from one node, called the sender, to another node, called the receiver. Although
special frames, called acknowledgment (ACK) and negative acknowledgment (NAK) can flow in the
opposite direction for flow and error control purposes, data flow in only one direction.
e

In a real-life network, the data link protocols are implemented as bidirectional; data flow in both
g

directions.
le

In these protocols the flow and error control information such as ACKs and NAKs is included in the data
frames in a technique called piggybacking.
ol
C

NOISELESS CHANNELS:
Let us first assume we have an idealchannel in which no frames are lost, duplicated, or corrupted. We
introduce two protocols for this type of channel. The first is a protocol that does not use flow control; the second
u

is the one that does.


ad

Simplest Protocol:
iln
m
Ta

26
<br>

Page 27 of 131

Sender Receiver
Network Get data Deliver data Network

Data link Data link

Physical| Send frame Receive frame Physical


Data frames

Request from
Event:
network layer
Repeat forever Repeat forever

g
in
Algorithm for sender site Algorithm for receiver site

er
Notification from
Event:
physical layer

e
The Simplest Protocol is one that has no flow control. It is a unidirectional protocol in which data frames

in
are traveling in only one direction-from the sender to receiver.

ng
The data link layer at the sender site gets data from its network layer, makes a frame out of the data, and
sends it. The data link layer at the receiver site receives a frame from its physical layer, extracts data from
the frame, and delivers the data to its network layer. fE
The data link layers of thesender and receiver provide transmission services for their network layers. The
O
data link layers use the services provided by their physical layers for the physical transmission of bits.
e

The sender sends a sequence of frames without even thinking about the receiver. To send three frames,
g

three events occur at the sender site and three events at the receiver site.
Note that the data frames are shown by tilted boxes; the height of the box defines the transmission time
le

difference between the first bit and the last bit in the frame.
ol

Sender Receiver
A B
C

Request Frame
Arrival
u

Request Frame
Arrival
ad

Request | Frame
Arrival
iln

Time Time

Stop-and-Wait Protocol:
m

The Stop-and-Wait Protocol sender sends one frame, stops until it receives confirmation from the receiver
Ta

(okay to go ahead), and then sends the next frame.


$ We still have unidirectional communication for data frames, but auxiliary ACK frames (simple tokens of
acknowledgment) travel from the other direction.

27
<br>

Page 28 of 131

Sender Receiver
Deliver
Network Get data data Network

Data link Data link

Physical Receive Send Receive Send Physical


frame frame frame frame
Data frame
-
ACK frame

Request from
Event:
network layer

g
Repeat forever Repeat forever

in
Algorithm for sender site Algorithm for receiver site

er
Notification from Event: Notification from
Event: physical layer physical layer

e
in
NOISY CHANNELS

ng
Although the Stop-and-Wait Protocol gives us an idea howto add flow control to its predecessor,
of

noiseless channels are nonexistent. We can ignore the error (as we sometimes do), or we need to add error
fE
control to our protocols. We discuss three protocols in this section that use error control.
Stop-and-Wait Automatic Repeat Request
Go-Back-N Automatic Repeat Request
O
Selective Repeat Automatic Repeat Request
e

Stop-and-Wait Automatic Repeat Request Protocol:


g
le

* This is the simplex protocol with sequence numbers and the ack frame indicating the sequence number of
ol

the next frame expected.


In this sliding window protocol, the maximum window size of 1. Such a protocol uses stop-and wait
C

since the sender transmits a frame and waits for its acknowledgement before sending the next one.
The sending device keeps a copy of the last frame transmitted until it receives an acknowledgement.
u

If the acknowledgement frame gets lost and data link layer on A eventually times out.Not having received
ad

an ACK, it assumes that its data frame was lost or damaged and sends the frame containing packet 1
iln

again.

Frames - alternately numbered as 0 and 1


m

Ack for frame0 = ACK 1


and for frame1= ACKO
Ta

Control Variables sender- S (no of recently sent frame)

receiver -R (no of next frame expected

Operation:

28
<br>

Page 29 of 131

,
The sender transmits the frame when frame arrives at receiver it checks for damage
and acknowledges to the sender accordingly. While transmitting a frame there can be four
situations.
Normal Operation
Frame lost
Acknowledgement lost
* Acknowledgement delayed

g
Normal operation

in
In normal operation the sender sends frame 0 and waits for acknowledgement ACK 1.After receiving

er
ACK 1, sender sends next frame l and waits for its acknowledgement ACKO. This operation is repeated.
$ The sender will not send the next piece of data until it is sure that the current one is correctly received

e
in
Sender Receiver

ng
S=0 Frame O
R= 0

S= 1
ACK 1
Frame 1
fE R=1

ACK 0
O
S= 0
g e

Time Time
le

Stop-and-Wait ARQ, lost frame


ol

Sender Receiver
C

S= 0 Frame 0
R=0
u

ACK I
S= 1
Frame R= 1
ad

Lost
Time-out Frame R= 1
1

S- 1
iln

ACK 0

S=0
R=0
m

Time Time
Ta

When a receiver receives a data frame that is out of order, this means that frames were either lost or
duplicated.

When sender does not receive its acknowledgement then the Corrupted and lost frames need to resent in
this protocol.

Stop-and-Wait ARQ, lost ACK frame

29
<br>

Page 30 of 131

Sender Receiver

S= 0 Frame o R=0
ACK 1
S= 1
Frame1 R= 1

ACK 0
Lost
Time-out S= 1
Frame 1 R=0

ACK 0 Expecting1 frame 0,


frame discarded

g
S= 0

in
Time Time

er
When an

e
,
acknowledgement is lost the sender does not know whether the frame is received by receiver.

in
After the timer
expires, the sender re-transmits the same frame. On the other hand, receiver has already received this

ng
frame earlier hence the second copy of the frame is discarded.

Stop-and-Wait ARQ, delayed ACK fE


Sender Receiver
O
S=0 Frame O
e

R=0
g

ACK
le

Time-out S=0 Frame 0 R=1


Expecting frame 1. |
ol

S=1 Frame 1

frame 0 discarded
ACK 1
C

Discarded|
S= 1 Frame 1
Time-out R=1
u

ACK 0
ad
iln

Time Time

The ACK frame may


m

be delayed due to some link problem.The ACK is received after the timer is elapsed. While the sender has
Ta

.
already transmitted the same frame
Again second ACK is
initiated by receiver for the retransmitted frame, hence the second ACK is discarded.
To avoid duplication
the ACK must be numbered.

Bidirectional Transmission
30
<br>

Page 31 of 131

R= 0 Frame 0,
S= 0 ACK 0 R=0
1
Frame 0, ACK S= 0
R=0
S= 1 Frame 1, ACK 1
R=1
Frame 1, ACK 0 S= 1

R=1
S=0

g
in
er
Time Time

Each party should

e
maintain S and R to track frames sent and expected.Piggybacking (hooking ack with next outgoing data

in
frame)can be used to save bandwidth

ng
Drawbacks of stop and wait
Only one frame can be in transit at a time
fE
after each frame sent the host must wait for an ACK.
O
inefficient use of bandwidth
e
g

Sliding Window Protocols


le

Sliding window
ol

Holds the unacknowledged outstanding frames in sender


-
C

Holds the expected frames in receiver


Sequence numbers
u

sent frames are numbered sequentially


2m -
ad

if the number of bits in the header is m then sequence number goes from O to l
Protocols
iln

Go back -N
Selective Repeat
m

Go Back -N
Ta

Sender window size < 2m


Receiver window size = 1
Why the name go back- N?
when the frame is damaged the sender goes back and sends a set of frames starting
from the last one ACKn'd
the number of retransmitted frames is N
Example:
31
<br>

Page 32 of 131

The window size is 4.


A
sender has sent frame 6 and the timer expires for frame 3 (frame 3 not ACKn'd). The
sender goes back and re-sends the frames 3, 4, 5 and 6.

Control variables:
S- holds the sequence number of the recently sent frame

• SF-holds sequence number of the first frame in the window

g
SL- holds the sequence number of the last frame

in
R-sequence number of the frame expected to be received

er
Window size W = S, -S + 1

e
Sender sliding window

in
Window size =7

ng
•..5670123|45670-..
a. Before sliding
fE
O
Window size =7

•..567012345670
g e

b. After sliding two frames


le

Receiver sliding window


ol
C

•.56701|2|345 |67o
u

a. Before sliding
ad

•.5 67 o 1
234567|o.
iln

b. After sliding
m

3|0 123o1]•o. ••.3|O12•.


Ta

Frames Frames waiting Frames received Frames that cannot


acknowledged to be sent and acknowledged be accepted
Sp S S R
a. Sender window b. Receiver window

Go-Back-N ARQ, normaloperation

32
<br>

Page 33 of 131

Sender Receiver

SF S
Frame 0 o123|012)
S
Frame 1

ACK 2
Frame 2 R

ACK 3
S
Frame3

g
R

in
Time Time

er
The sender sends

e
frames and update the control variables. S,, Sp,S and receiver updates the control variable R.

in
Go-Back-N ARQ, lost frame

ng
Sender Receiver

S,

S
S

Frame 0
fE o23|o]1|2)
R

Frane 1
O
opaao||2 CK 2 o23|0o|1|2)
R
Framne 2
e

LOst o123|o|1|2]
Framne 3
g

Discarded Frame 3 discarded.


not in the window
le

Reseent Frane 2
Time-out oTa|o12]
NCK 3
ol

Frane 3
Resent o|2o|2)
C

Time Time
u

Suppose frame 2 is
ad

damaged or lost and of receiver frame 3, it will be discarded since it is expecting frame 2.Sender
retransmits frame 2 and frame 3.
iln

In Go-Back-N ARO, the size of the sender window must be less than 2"; the size of the receiver window
m

is always 1.
Ta

Go-Back-N ARQ: sender window size

33
<br>

Page 34 of 131

Sender Receiver Sender Receiver

Frame Frame0
o123 0 o230 on23o
R R
Frame Frame 1
1
S R
o230R
Frame Frame
2 2
R
Frame Frame
Time-out 0 3

g
R R
Correctly Frame

in
Time-out 0
discarded
R

er
Erroneously
accepted

e
a. Window size < 2m b. Window size = 2m

in
ng
Selective Repeat ARQ:
fE Processing at the
receiver is more complex.
O
In Selective Repeat
ARQ, the size of the sender and receiver window must be at most one-half of 2m,
e

Both the transmitter


g

and the receiver have the same window size


le

Receiver expects
frames within the range of the sequence numbers
ol

Selective Repeat ARQ - sender and receiver windows


C
u

•30|12 3O1•. •.3 0|12301•.


ad

Frame Frames waiting Frames received Frames that cannot


iln

acknowledged to be sent and acknowledged be accepted


m

Sp S S,
Ta

a. Sender window b. Receiver window

Selective Repeat ARQ, lost frame:

34
<br>

Page 35 of 131

Sender Receiver

Frame 0
23|o|1|2]
Frame l
O23o12]
ACK 2
Frame 2
Lost
Frame 3

g
[O12Bo1|2) NAK 2 [o12sol1|2

in
Resent
Frame 2

e er
Time Time

in
In sequential
transmission of frame 0,1,2,3 suppose frame 2 is lost and the next frame

ng
3 is already received sends NAK
2 frame to sender. The sender retransmits frame 2 only.
fE
O
g e

Selective Repeat ARQ, sender window size


le

Sender Receiver
ol

Frame
Sender Receiver 0
C

S
Frame Framel
0
u

S
ad

Frame 1 Frame2
iln

Frame Frame
Time-out 0 Time-out 0
m

Correctly Erroneously
|Discarded accepted
Ta

Time Time Time Time


a. Window size = 2m-1 b. Window size > 2m-1

35
<br>

Page 36 of 131

Ethernet (802.3)
IEEE 802.3 standard in detail.
D Digital Equipment and Intel Corporation joined Xerox to define Ethernet standard in
1978. It then formed the basis for IEEE standard 802.3
Standard Ethernet has a data rate of 10 Mbps. It is easy to administer and maintain.
D

D Ethernet has evolved to Fast Ethernet (100 Mbps), Gigabit Ethernet (1 Gbps) and Ten

Gigabit Ethernet (10 Gbps).


Ethernet is limited to supporting a maximum of 1024 hosts.
D
Ethernet has a total reach of only 2500 m by using repeaters.
D
Ethernet produces better throughput only under lightly loaded conditions.

g
Physical Properties

in
Transceiver

er
Ethernet cable

e
,Adaptor

in
ng
fE
Host
O
Ethernet uses Manchester encoding scheme and digital signaling (baseband) at 10 Mbps.
Hosts connect to the Ethernet segment by tapping, each at least 2.5 m apart.
e

D
The transceiver is responsible for transmitting/receiving frames and collision detection.
g
le

Hosts connect to an Ethernet segment by tapping into it.


A transceiver (a small device directly attached to the tap) detects when the line is idle and drives signal
ol

when the host is transmitting.


C

The transceiver also receives incoming signal.


The transceiver is connected to an Ethernet adaptor which is plugged into the host.
The protocol is implemented on the adaptor.
u
ad

Multiple Ethernet segments can be joined together by repeaters. A repeater is a device that forwards digital
signals. No more than four repeaters may be positioned between any pair of hosts. An Ethernet has a total reach
iln

of only 2500 m.
m
Ta

Repeater

Host

It's also possible to create a multiway repeater, sometimes called a hub. Any signal placed on the Ethernet
by host is broadcast over the entire network; that is, the signal is propagated in both directions, and repeaters
a
36
<br>

Page 37 of 131

and hubs forward the signal on all outgoing segments. Terminators attached to the end of each segment absorb the
signal.

Hub Hub

The various forms of Standard Ethernet are 10Base5, 10Base2, 10Base-T & 10Base-F

g
10Base5 (Thick Ethernet)

in
Thick Ethernet uses bus topology with an external transceiver
D

Collision occurs only in the thick coaxial cable.


D

er
The maximum length of the cable must not exceed 500m.
D

e
10Base2 (Thin Ethernet)
Thin Ethernet also uses bus topology, but the cable is much thinner and more flexible.
D

in
The transceiver is part of the network interface card (NIC).
O

The length of each segment should not exceed 185m and is less expensive.

ng
D

10Base-T (Twisted-Pair Ethernet)


10Base-T uses a star topology.
D

D
The maximum length of the twisted cable is 100m
fE
The stations are connected to a hub via two pairs of twisted cable.
D
Collision happens in the hub only.
O
10Base-F (Fiber Ethernet)
10Base-F uses star topology to connect stations to a hub.
D
e

Stations are connected to the hub using two fiber-opticcables with a max. length of
D
g

2000m.
le

10" in 10Base2 means that the network operates at 10 Mbps,


ol

“Base" refers to the fact that the cable is used in a baseband system,
*2" means that a given segment can be no longer than 200 m.
C

"T" stands for twisted pair, limited to less than 100 m in length
u

Frame Format
ad

64 48 48 16 32

Preamble Dest Sre Type Body CRC


addr addr
iln

contains alternating Os and Is that alerts the receiving system and enables it to synchronize
D

Preamble
m

its input timing.


D
Destination address-contains physical address of the destination host.
Ta

D
Source addresscontains the physical address of the sender.
D
Type/Length -It may contain either type of the upper layer protocol or frame length.
D
Data carries data (46-1500 bytes) encapsulated from the upper-layer protocols.
D
CRC the last field contains error detection information (CRC-32).
Addressing
D
Each host on the Ethernet network has its own network interface card (NIC).
O NIC provides a globally unique 6-byte physical address (in hex, delimited by colon).
Each manufacturer is given a unique prefix (3 bytes).

37
<br>

Page 38 of 131

IfLSB of the first byte in adestination address is 0, then it is unicast else multicast.
O

Inbroadcast address, all bits are 1s.


D

Transmitter algorithm
Ethernet is a working example of CSMA/CD.
D

D
Minimum frame length (64 bytes) is required for operation of CSMA/CD.
Signals placed on the ethernet propagate in both directions and is broadcasted over the
D

entire network.
Ethernet is said to be a 1-persistent protocol. When the adaptor has a frame to send:
D

o If line is idle, it transmits the frame immediately.


o If line is busy, it waits for the line to go idle and then transmits immediately.
O
It is possible for two (or more) adaptors to begin transmitting at the same time.

g
o In such case, the frames collide

in
o A 96-bit runt frame (64-bit preamble + 32-bit jamming sequence) is sent and

er
transmission is aborted.
O
Retransmission is attempted after a back-off procedure (k x 51.2us)

e
This protocol is applicable to a bus topology.

in
Before a station can transmit, it listens to the channelto see if any other station is already transmitting.

ng
If the station finds the channel idle, it attempt to transmit;
Otherwise, it waits for the channel to become idle.
If two or more stations find the channel idle and simultaneously attempt to transmit.
fE
This is called a collision. When collision occurs, the station should suspend transmission and re-attempts
after a random period of time.
Use of a random wait period reduces the chance of the collision recurring.
O
The following flow chart depicts this technique.
g e

Network access
le

Node is ready-to
ol

transmit
C

no Wait according
Transmission Backoff strategy
mediunm free?
u

yes
Send
ad

Start sending of data Jam signal


iln

yes
Colision?
m

no
no End of
Ta

transmnission
yes
Network access
finished

Receiver algorithm
D Each frame transmitted on an Ethernet is received by every adaptor on that network.

38
<br>

Page 39 of 131

Ethernet receives broadcast frames, frames addressed to it and multicast frames if it


O

belongs to that group. Otherwise frames are discarded.


Receives all frames, if it runs in promiscuous mode.
D

D
Ethernet does not provide any mechanism for acknowledging received frames, making it as an
unreliable medium.
Addresses
Each frame transmitted on an Ethernet is received by every adaptor connected to that Ethernet. Each
adaptor recognizes those frames addressed to its address and passes only those frames on to the host. In addition,
to unicast address, an Ethernet address consisting of all 1s is treated as a broadcast address. All adaptors pass
frames addressed to the broadcast address up to the host. Similarly, an address that has the first bit set to 1 but is
not the broadcast address is called a multicast address. A given host can program its adaptor to accept some set of

g
multicast addresses.

in
For example,
8:0:2b:e4:b1:2 is the human-readable representation of Ethernet address00001000 00000000 00101011 11100100

er
10110001 00000010 To ensure that every adaptor gets a unique address,
Tosummarize, an Ethernet adaptor receives all frames and accepts

e
Frames addressed to its own address

in
Frames addressed to the broadcast address
Frames addressed to a multicast addressed if it has been instructed

ng
When this happens, the two (or more) frames are said to be collide on the network.One way that an
adaptor will send only 96 bit (called a runt frame) is if the two hosts are close to each other. Had they been
fE
farther apart, they would have had to transmit longer, and thus send more bits, before detecting the collision. The
worst case scenario happens when the two hosts are at opposite ends of the Ethernet.
If the frame it's just sent did not collide with another frame, the transmitter may need to send as many as
O
512 bits. Every Ethernet frame must be at least 512 bits (64 bytes) long. 14 bytes of header + 46 bytes of data + 4
bytes of CRC.Why 512 bits?Why is its length limited to 2500 mThe farther apart two nodes are, the longer it
e

takes for a frame sent by one to reach the other, and the network is vulnerable to collision during this
g

The minimum frame length in Ethernet should be at least 64 bytes?


le

Consider the following worst case scenario in which hosts A and B are at either ends.
D
ol

B
C

(a) (b)
u
ad

BR
A
iln

(c) (d
m

D
begins transmitting a frame at time t, as shown in (a).
Host A
Ta

takes one link latency (say d) for the frame to reach host B. Thus, the first bit of A's
frame arrives at B at time t + d, as shown in (b).
D
Suppose an instant before host A's frame arrives, B senses it idle line, host B begins to
transmit its own frame.
B's frame will immediately collide with A's frame, and this collision willbe detected by host B (C).
D

Host B will send the 32-bit jamming sequence.


D
Host A will not know that the collision occurred until B's frame reaches it, i.e., at time t + 2d, as shown
in (d).

39
<br>

Page 40 of 131

On a maximally configured Ethernet, round-trip delay is 51.2 us, i.e., 512 bits (64 bytes)
Fast ethernet
D
Fast Ethernet is IEEE 802.3u standard and was invented compete with LAN protocols
such as FDDI.
D
The data rate in Fast ethernet is 100 Mbps.
D Fast ethernet uses star topology.

the function of a repeater


DA repeater is a device that connects segments of a LAN.
DA repeater reconstructsthe received weak signal to its original strength and forwards it.
D
Itoperates in the physical layer.
O
It can extend the length of a LAN network

g
in
wireless Technologies:

er
Four prominent wireless technologies:
Bluetooth (802.15.1)

e
Wi-Fi (802.11)
WiMAX (802.16)

in
Third generation or 3G cellular wireless

ng
WIRELESSLAN (802.11)

fE
Wireless links transmit electromagnetic signals (Radio, microwave, infrared). Wireless links all shares the
same wire" (so to speak).The challenge is to share it efficiently without unduly interfering with each other.
Most of this sharing is accomplished by dividing the "wire" along the dimensions of frequency and space.
O
These allocations are determined by government agencies such as FCC (Federal Communications
Commission) in USA.Specific bands (frequency) ranges are allocated to certain uses. Some bands are reserved
e

for government use Other bands are reserved for uses such as AM radio, FM radio, televisions, satellite
g

communications, and cell phones Specific frequencies within these bands are then allocated to individual
organizations for use within certain geographical areas.
le

Devices that use license-exempt frequencies are still subject to certain restrictions.
ol

The first is a limit on transmission power this limits the range of signal, making it less likely to interfere
with another signal for example; a cordless phone might have a range of about 100 feet.
C

The second restriction requires the use of Spread Spectrum technique Idea is to spread the signal over a
wider frequency band So as to minimize the impact of interference from other devices originally designed for
u

military use.
ad

Frequency hopping:
Transmitting signal over a random sequence of frequencies
First transmitting at one frequency, then a second, then a third...The sequence of frequencies are not truly
iln

random, instead computed algorithmically by a pseudorandom number generator. The receiver uses the same
algorithm as the sender, initializes it with the same seed, and is able to hop frequencies in sync with the
m

transmitter to correctly receive the frame A second spread spectrum technique called direct sequence. Represents
each bit in the frame by multiple bits in the transmitted signal. For each bit the sender wants to transmit it actually
Ta

sends the exclusive OR of that bit and n random bits. The sequence of random bits is generated by a
pseudorandom number generator known to both the sender and the receiver. The transmitted values, known as an
n-bit chipping code, spread the signal across a frequency band that is n times wider

40
<br>

Page 41 of 131

1
Data stream: 1010

Random sequence: 0100101101011001


1

XOR of the two: 1011101110101001


4-bit chipping sequence
Mostly widely used wireless links today are usually asymmetric
Two end-points are usually different kinds of nodes
One end-point usually has no mobility, but has wired connection to the Internet (known as base station)
The node at the other end of the link is often mobile

g
in
er
Client node

e
Wired

in
network

Base station

ng
Client node
fE
Key

Wireless "link"
between 2 nodes
O
Wireless communication supports point-to-multipoint communication
Communication between non-base (client) nodes is routed via the base station
e

Three levels of mobility for clients


g

No mobility: the receiver must be in a fix location to receive a directional transmission from the base
le

station (initial version of WiMAX)


Mobility is within the range of a base (Bluetooth)
ol

Mobility between bases (Cell phones and Wi-Fi)


C

We
discussthree prominent wireless technologies:
Bluetooth (802.15.1) Wi-Fi (802.11) 3G Cellular
u

Typical link length 10 m 100 m Tens of kilometers


ad

Typical data rate 2 Mbps (shared) 54 Mbps (shared) Hundreds of


kbps
(per connection)
iln

Typical use Link a peripheral Link acomputer Link a mobile phone


m

to a computer to a wired base to a wired tower


Wired technology USB Ethernet DSL
Ta

analogy

An alternative topology that is seeing increasing interest is the mesh or ad hoc network. In a wireless
mesh, nodes are peers; that is, there is no special base station node. Messages may be forwarded via a chain of
peer nodes as long as each node is within range of the preceding node.

41
<br>

Page 42 of 131

Mobile node

Mobile
node

Wireless
ransmission
Mobile
node

Mobile node

g
Mobile node

in
Mobile node

er
IGURE 2.29 Awiteless ad ho or mesh network

e
IEEE 802.11(wireless network, Wi-Fi)

in
Wireless network based on the IEEE 802.11 standards, often referred to as Wi-Fi (wireless fidelity). It is
technically a trademark, owned by a trade group called the Wi-Fi Alliance, which certifies product compliance

ng
with 802.11. Like Ethernet, 802. 11 is designed for use in a limited geographical area (homes, office buildings,
campuses), and its primary challenge is to mediate access to a shared communication medium -in this case,
signals propagating through space.
Physical Properties
fE
802.11define a number of different physical layers that operate in various frequency
O
Band provides a range of different data rates.
The original 802.11 standard defined two radio-based physical layers standards
e

1. Frequency hopping (over 79 1-MHz-wide frequency bandwidths)


g

2. Direct sequence spread spectrum (with an 11-bit chipping sequence).


le

Both provided data rates in the 2 Mbps range.


>
The physical layer standard
ol

1. 802.11b provides up to 11 Mbps which is sufficient for most home networks with broadband cable,
operated in the license 2.4-GHz frequency band of the electromagnetic spectrum.
C

2. 802.11a which delivers up to 54 Mbps using a variant of FDM called orthogonal frequency
division multiplexing (0FDM); it runs in the license 5-GHz band. On one hand, this band is less used, so
u

there is less interference. On the other hand, there is more absorption of the signal and it is limited to almost
ad

line of sight.
3. 802.11g followed; 802.11g also uses OFDM, delivers up to 54 Mbps, and is backward compatible
with 802. 11b (and returns to the 2.4-GHz band).
iln

4. 802.l In has appeared on the scene, it achieves considerable advances in maximum possible data
rate using multiple antennas and allowing greater wireless channel bandwidths. The use of multiple antennas
m

is often called MIMO for multiple inputs, multiple-output.


Ta

The 802.11 standards define a maximum bit rate that can be supported, they mostly support lower bit rates as well;
for example, 802.1 la allows for bit rates of 9, 12, 18, 24, 36, 48 and 54 Mbps. At lower bit rates, it is easier to
6,

decode transmitted signals in the presence of noise in the form of error-correcting codes is varied.
The 802.11standards do not specify a particular approach but leave the algorithms to the various vendors.
The basic approach to picking a bit rate is to estimate the bit error rate either by directly measuring the signal-to
noise ratio (SNR)at the physical layer or by estimating the SNR by mneasuring how often packets are successfully
transmitted and acknowledged.

42
<br>

Page 43 of 131

Collision Avoidance
A wireless protocol would follow the same algorithm as the Ethernet-wait until the link becomes idle
before transmitting and a
back off should collision occur.
Ethernet receives every other node's transmissions and can transmit and receive at the same time, neither
of these conditions holds for wireless nodes. This makes detection of collisions rather more complex.
The reason why wireless nodes cannot usually transmit and receive at the same time (on the same
frequency) is that the power generated by the transmitter is much higher than any received signal swamps the
receiving circuitry.
The reason why a node may not receive transmissions from another node is because that node may be too
far away or blocked by an obstacle.

g
in
e er
in
A B

ng
fE
O
IFIGURE 2.30 The hidden node problem. Although A and Care hidden from each other, their signals can collide at B.

(B's reach is not shown.)


g e

Consider the situation in the following figure (2.30) where each of three nodes is able to send and receive signals
le

that reach just the nodes to its immediate left and right.
1. A andC are both within range of
ol

but not each other.


B

2. Suppose both A and C want to communicate with B and so they each send it a frame.
C

3. A and C are unaware of each other since their signals do not carry that far.
These two frames collide with each other at B but unlike an Ethernet neither A nor C is aware of this collision. A
u

and C are said to be hidden nodes with respect to each other.


ad

A related problem, called the exposed node problem


iln
m
Ta

43
<br>

Page 44 of 131

A D

g
in
e er
IFIGURE 2.31 The exposed node problem. Although B and Care exposed to each other's signals, there is no

in
interference ifB transmits to A while C transmits to D. (A and D's reaches are not shown.)

ng
Where each of the four nodes is able to send and receive signals that reach just the nodes to its immediate left and
right.
1. B
can exchange frames with A andC but it cannot reach D
2. While C can reach B and D but not A.
fE
3. Suppose B is sending to A. Node C is aware of this communication because it hears B's transmission.
O
However, for to conclude that it cannot transmit to anyone just because it can hear B's transmission.
C

4. For example, suppose C wants to transmit to node D. This is not a problem since C's transmission to
e

willnot interfere with A's ability to receive from B. (It would interfere with A sending to B, but B is
g

transmitting in our example.)


le

802.11addresses these problems by using CSMA/CA, where the CA stands for collision avoidance, in contrast to
the collision detection of CSMA/CD used on Ethernets.
ol

Key Idea
Sender and receiver exchange control frames with each other before the sender actually transmits
C

any data.
V This exchange informs all nearby nodes that a transmission is about to begin
u

V Sender transmits a Request to Send (RTS) frame to the receiver. The RTS frame includes a field
ad

that indicates how long the sender wants to hold the medium- Length of the data frame to be
transmitted
Receiver replies with a Clear to Send (CTS) frame. This frame echoes this length field back to the
iln

sender
Any node that sees the CTS frame knows that
m

> it is close to the receiver, therefore


cannot transmit for the period of time it takes to send a frame of the specified length
Ta

Any node that sees the RTS frame but not the CTS frame
Is not close enough to the receiver to interfere with it, and
so is free to transmit
Using ACK in MAC AProposed in MACAW: MACA for Wireless LANS Receiver sends an ACK to the sender
after successfully receiving a frame AIl nodes must wait for this ACK before trying to transmit If two or more
nodes detect an idle link and try to transmit an RTS frame at the same time. Their RTS frame will collide with
each other

44
<br>

Page 45 of 131

A 802.11 does not support collision detection


o So the senders realize the collision has happened when they do not receive the CTS frame after a
period of time.
In this case, they each wait a random amount of time before trying again. The amount of time a
given node delays is defined by the same exponential back off algorithm used on the Ethernet
Distributed Systems
802.11 are suitable for an ad-hoc configuration of nodes that may or may not be able to communicate with all
other nodes. Nodes are free to move around. The set of directly reachable nodes may change over time
802.11 defines additional structures on a set of nodes
Instead of all nodes being created equal
some nodes are allowed to roam

g
some are connected to a wired network infrastructure

in
- are
They called Access Points (AP) and they are connected to each other by a so-called distribution system
Figure below illustrates a distribution system that connects three access points, each of which services the

er
nodes in some region.

e
in
Distribution systerm

ng
AP-1
fE AP-3
O
AP-2 F
A B G
e

H
g
le

E
D
ol

Access points connected to Distributed System


C

Each access point operates on some channel in the appropriate frequency range, and each AP will
typically be on a different channel than its neighbors.
u

> The only important point is that the distribution network operates at the link layer, the same protocol layer
ad

as the wireless links


For node A to communicate with node E, for example, A first sends a frame to its access point (AP-1), which
forwards the frame across the distribution system to AP-3, which finally transmits the frame to E. How AP-1
iln

knew to forward the message to AP-3 is beyond the scope of 802.11;


How do the nodes select their access points? How does it work when nodes move from one cell to another?
m

The technique for selecting an AP is called scanning


The node sends a Probe frame
Ta

AllAPs within reach reply with a Probe Response frame


The node selects one of the access points and sends that AP an Association Request frame.
The AP replies with an Association Response frame
A node engages this protocol whenever it joins the network, as well as when it becomes unhappy with its
current AP This might happen, for example, because the signal from its current AP has weakened due to the node
moving away from it
Whenever a node acquires a new AP, the new AP notifies the old AP of the change via the distribution
system.
45
<br>

Page 46 of 131

Distribution system

AP-1 AP-3
AP-2

g
A B G

in
H

er
C
E

e
D

in
Node mobility

ng
Consider the situation shown in the following figure when node C moves from the cell serviced by AP-1 to
the cell serviced by AP-2.

Atsome point, C
fE
As it moves, it sends Probe frames, which eventually result in Probe Responses from AP-2.
prefers AP-2 over AP-1, and so it associates itself with that access point.
V This is called active scanning since the node is actively searching for an access point
O
APs also periodically send a Beacon frame that advertises the capabilities of the access point; these
include the transmission rate supported by the AP
e

This is called passive scanning


g

A node can change to this AP based on the Beacon frame simply by sending it an Association
Request frame back to the access point.
le

Frame Format
ol

The 802.11frame format which is depicted in the figure.


The frame contains the source and destination node addresses, each of which is 48 bits long; up to 2312
C

bytes of data.
V a 32-bit CRC.
u

V The Control field contains three subfields of interest


ad

6 bit Type field: indicates whether the frame is an RTS or CTS frame or being used by the
scanning algorithm
pair of 1bit fields : called ToDS and FromDS
iln

16 16 48 48 48 16 48 0-18,496 32
m

Control Duration Addr1 Addr2 Addr3 SeqCtrl Addr4 Payload CRC


Ta

Frame Format of 802.11


Frame contains four addresses, How these addresses are interpreted depends on the settings of the ToDS
and FromDS bits in the frame's Control field
This is to account for the possibility that the frame had to be forwarded across the distribution system.
the original sender is not necessarily the same as the most recent transmitting node Same is true for the
destination address
Simplest case

46
<br>

Page 47 of 131

When one node is sending directly to another, both the DS bits are 0, Addrl identifies the
target node, and Addr2 identifies the source node
Most complex case both DS bits are set to 1 Indicates that the message went from a wireless node onto the
distribution system, and then from the distribution system to another wireless node
V ADDRESS REFERS
Addrl identifies the ultimate destination,
Addr2 identifies the immediate sender (the one that forwarded the frame from the
distribution system to the ultimate destination)
Addr3 identifies the intermediate destination (the one that accepted the frame from a
wireless node and forwarded across the distribution system)
> Addr4 identifies the original source

g
in
BLUETO0TH802.15.1)

er
Bluetooth fills the niche of very short range communication between mobile phones, PDAs, notebook
computers, and other personal or peripheral devices.

e
For examnple, Bluetooth can be used to connect a mobile phone to a headset or a notebook computer to a

in
keyboard.
Bluetooth radios can use quite low power transmission, since transmission power is one

ng
Of the main factors affecting bandwidth and range of wireless links
Bluetooth operates in the license-exempt band at 2.45 GHz.

10 m.
fE
Bluetooth links have typical bandwidths around 1 to 3 Mbps and a range of about

Bluetooth is sometimes categorized as a Personal Area Network (PAN).


O
Bluetooth is specified by an industry consortium called the Bluetooth Special Interest Group.
It specifies an entire suite of protocols, going beyond the link layer to define application protocols, which
e

it calls profiles, for a range of applications.


g

For example, there is a profile for synchronizing a PDA with a personal computer.
The basic Bluetooth network configuration, called a piconet, consists of a master device and up to seven
le

slave devices.
ol

Any communication is between the master and a slave.


The slaves do not communicate directly with each other. Because slaves have a simpler role, their
C

Bluetooth hardware and software can be simpler and cheaper.


Bluetooth use a spread spectrum technique (as discussed at the start of this section) to deal with possible
u

interference in the band. It uses frequency-hopping with 79 channels (frequencies), using each for 625 us
ad

at a time.
Only the master can start to transmit in odd-numbered slots. A slave can start to transmit in an even
numbered slot
iln

A slave device can be parked; that is, it is set to an inactive, low-power state. A parked device cannot
communicate on the piconet; it can only be reactivated by the master.
m

A piconet can have up to 255 parked devices in addition to its active slave devices.
Ta

47
<br>

Page 48 of 131

Slave

ocoooooo (parked)

Slave Slave
(active) (active)

OOCC0000 Master

g
in
Slave
Slave (active)
(parked)

e er
Slave

in
(active)
A Bluetooth Piconet

ng
ZigBee
IEEE 802.15.4. fE
> It is designed for situations where the bandwidth requirements are low and power consumption must be
very low to give very long battery life.
O
> It is also intended to be simpler and cheaper than Bluetooth, cheaper devices such as sensors.
g e
le
ol
C
u
ad
iln
m
Ta

48
<br>

Page 49 of 131

UNIT II
NETWORK LAYER PROTOCOLS
Network Layer - IPy4 Addressing – Network Layer Protocols (IP, ICMP and Mobile IP) Unicast and
Multicast Routing Intradomain and Interdomain Routing Protocols - IPv6 Addresses - IPv6
-
Datagram Format Transition from IPv4 to IPv6.

ROUTING:
Routers have enough knowledge of the network topology so they can choose the right port onto which each
packet should be output

g
Forwarding versus Routing

in
Forwarding:
to select an output port based on destination address and routing table

er
Routing:
process by which routing table is built.

e
Process of finding a path from source to destination to deliver the packets. It is n/w layer

in
responsibility for deciding o/p lines for an incoming packet.

ng
Forwarding table VS Routing table
Forwarding table
Used when a packet is being forwarded and so must contain enough information
to accomplish the forwarding function fE
A row in the forwarding table contains the mapping from a network number to an
outgoing interface and some MAC information, such as Ethernet Address of the
O
next hop
Routing table
e

Built by the routing algorithm as a precursor to build the forwarding table


g

Generally contains mapping from network numbers to next hops


le

(a)
ol

Prefix/Length Next Hop


C

18/8 171.69.245.10

(b)
u

Prefix/Length Interface MAC Address


ad

18/8 ifo 80-2b:e4:b:1:2


iln

Example rows from (a) routing and (b) forwarding tables


Routing Protocols
m

Network as a Graph
Ta

1
<br>

Page 50 of 131

The nodes of the graph, labeled Athrough F, may be hosts, switches, routers, or networks. For our
initialdiscussion, we will focus on the case where the nodes are routers.
Theedges of the graph correspond to the network links. Each edge has anassociated cost, which gives
some indication of the desirability of sendingtraffic over that link.
The basic problem of routing is to find the lowest-cost path between any two nodes, where the cost of a
path equals the sum of the costs of all the edges that make up the path.
Routing is the process by which routing tables are built. The routing tables are used to find the path
between every pair of nodes in a network.
The routing depends on complex distributed algorithms.There are two types of routing protocols. They

g
are
1. Intra domain routing protocol or Interior Gateway Protocol all the routers are under the same

in
administrative control.

er
2. Inter domain routing protocol controlled by different administrative control.
> For a simple network, we can calculate all shortest paths and load them into some nonvolatile storage

e
on each node.

in
Such a static approach has several shortcomings
It does not deal with node or link failures

ng
It does not consider the addition of new nodes or links
It implies that edge costs cannot change
> Need a distributed and dynamic protocol
Two main classes of protocols
fE
• Distance Vector(RIP)
O
• Link State (OSPF)

Popular routing protocols


g e

Routing protocols
le
ol

Intradomain Interdomain
C
u

|Distancevector Link state Path vector


ad

RIP OSPF BGP


iln

Routing Information Protocol (RIP)


m

This is one of the most widely used IGP. It was developed at Berkeley. This is also known by the name
Ta

of the program that implements it, routed .This implements Distance Vector algorithm.
Distance Vector Routing:
The distance vector routing algorithm is sometimes called as Bellman-Ford algorithm.
Every T seconds each router sends its table to its neighbor each router then updates its table based on
the new information.
Problems include fast response to good new and slow response to bad news. Also too many messages
to update.

2
<br>

Page 51 of 131

Each node constructs a one dimensional array (a vector) containing the distances" (costs) to all other
nodes and distributes that vector to its immediate neighbors
Initialization
The tables are stable; each node knows how to reach any other node and the cost. Each node can know
only the distance between itself and its immediate neighbors, those directly connected to it.
So for the moment, we assume that each node can send a message to the immediate neighbors and find
the distance between itself and these neighbors. The distance for any entry that is not a neighbor is
marked as infinite.

g
in
e er
in
ng
Information Distance to Reach Node

Stored at Node A C D F G Initial distances stored at


each node (global view)
A

B
0

1
1

1
fE
8-8 8
1 1

C 1 1
8
O
8
1
0 1

m
0 0
e

F 1
g

G 8 1 1
0
le
ol

Table 3.11 Inital Routing Table at Node A


C

Destination Cost NextHop


B 1 B
u

1 C
ad

E 1 E
iln

F F
m
Ta

Sharing
The whole idea of distance vector routing is the sharing of information between neighbors.
Node A does not know about node G, node F does. So if node F shares its routing table with A, node A
can also know how to reach node G.
Nodes A and F, as immediate neighbors, can improve their routing tables if they help each other.
3
<br>

Page 52 of 131

There is only one problem. How much of the table must be shared with each neighbor?A node
is not aware of a neighbor's table.
The best solution for each node is to send its entire table to the neighbor and let the neighbor
decide what part to use and what part to discard. However, the third column of a table (next
stop) is not useful for the neighbor.
When the neighbor receives atable, this column needs to be replaced with the sender's name. If
any of the rows can be used, the next node is the sender of the table.
A node therefore can send only the first two columns of its table to any neighbor. Sharing here
means sharing only the first twocolumns.
means sharing only the first twocolumns.

g
Updating
* Whena node receives a two-column table from a neighbor, it needs to update its routingtable. Updating

in
takes three steps:

er
1.The receiving node needs to add the cost between itself and the sending node to each value in the
second column.

e
2. The receiving node needs to add the name of the sending node to each row as the third column if the
receiving node uses information from any row. The sending node is the next node in the route.

in
3. The receiving node needs tocompare each row of its old table with the coresponding row of the

ng
modified version of the received table.
a. If the next-node entry is different, the receiving node chooses the row with the smaller cost. If
there is a tie, the old one is kept. fE
b. If the next-node entry is the same, the receiving node chooses the new row.
c. Node A must not ignore this value even though its old entry is smaller. The old route does
not exist anymore. The new route has a distance of infinity.
O
e

Table 3.12 Fnal Routing Table at Node A


g

Destinatlon Cost NextHop


le

B 1
B
ol

C 1 C
D 2
C

E 1 E

F 1
F
u

G F
ad

Distance to Reach Node


iln

Information
Stored at Node A B D E F G
m

A 1 1 NN-O
2 1
2

B 1 1
2 2 2 3
Ta

C 1 1 1
2 2 2
2 1
3 2 1

E 1
2 2 m 3 2 3

2 2 2 2 1

G 2 3 2 1 3 1

Final distances stored at each node (global view)


4
<br>

Page 53 of 131

When a node detects a link failure


F detects that link to G has failed
F sets distance to G to infinity and sends update to A
A sets distance to G to infinity since it uses F to reach G
A receives periodic update from C with 2-hop path to G
A sets distance to G to 3 and sends update to F
F decides it can reach G in 4 hops via A

Count-to-lnfinity problem:
Slightly different circumstances can prevent the network from stabilizing

g
in
Suppose the link from A to E goes down
In the next round of updates, A advertises a distance of infinity to E, but B and C advertise a

er
distance of 2 to E

e
Depending on the exact timing of events, the following might happen
Node B, upon hearing that E can be reached in 2 hops from C, concludes that it can

in
reach E in 3 hops and advertises this to A

ng
Node A concludes that it can reach E in 4 hops and advertises this to C
Node C concludes that it can reach E in 5 hops; and so on.
This cycle stops only when the distances reach some number that is large enough to be
fE
considered infinite
O
Partial solutions to this problem are
1) Touse some relatively small number as an approximation of infinity.
2) Split horizon.
e

When a node sends a routing update to its neighbors, it does not send those routes itlearned from each
g

neighbor back to that neighbor.


le

Solution
split horizon:If B has the route (E, 2, A) in its table, then it knows it must have learned this route from
ol

A, and so whenever B sends a routing update to A, it does not include the route for E
split horizon with poison reverse:B actually sends that route back to A., but it puts negative
C

information in the route to ensure that A will not eventually use B to get to
E.ie (E, o ) to A.
u
ad

Routing Information Protocol (RIP)

This is one of the most widely used IGP. It was developed at Berkeley. This is also known by the name of the
iln

program that implements it, routed .This implements Distance Vector algorithm.
m

Features of RIP:
Ta

RIP uses a hop count metric to measure the distance to a destination. To compensate for differences in
technologies, many RIP implementations allow managers to configure artificially high hop counts
when advertising connections to slow networks. Allrouting updates are broadcast. This allows all hosts
on the network to know about the routes.

To prevent routes from oscillating between two or more equal cost paths, RIP specifies that existing
routes should be retained until a new route has strictly lower cost. Since RIP does not explicitly detect
5
<br>

Page 54 of 131

routing loops, RIP must either assume participants can be trusted (being part of one autonomous
system) or take precautions to prevent such loops.

To prevent instabilities, RIP must use a low value for the maximum possible distance.RIP uses 16 as
the maximum hop count. This restricts the maximum network diameter of the system to l16.

To solve the slow convergence problem arising due to slow propagation of routing information, RIP
uses Hold Down. If a particular link is down, any new information about that link is not accepted till
some time. This is because the router must wait till the information about the link being down
propagates to another router before accepting information from that router about that down link.

g
in
RIP runs on top of TCP/IP. RIP allows addresses to be of a maximum size of 14 Bytes. The Distance
varies from 1 to 16 (where 16 is used to signify infinity). RIP address 0.0.0.0 denotes a default route.

er
There is no explicit size of the RIP message and any number of routes can be advertised.

e
in
ng
fE
O
g e

Example Network Running RIP


le

The message format is as shown:


ol

RIP v2 Packet Format


C

8 16 31
Command Version Must be zero
u

Family of net 1 Route Tags


ad

Address prefix of net


1

Mask of net 1
iln

Distance to net 1
m

Family of net 2 Route Tags


Ta

Address prefix of net 2


Mask of net 2

Distance to net 2

6
<br>

Page 55 of 131

Link State Routing(OSPE)


In link state routing, four sets of actions are required to ensure that each node has the routing table
showing the least-cost node to every other node.
1. Creation of the states of the links by each node, called the link state packet (LSP).
2. Dissemination of LSPs to every other router, called flooding, in an efficient and reliable way.
3. Formation of a shortest path tree for each node.
4. Calculation of a routing table based on the shortest path tree.
* Strategy: Send to all nodes (not just neighbors) information about directly connected links (not entire
routing table).
Creation of Link State Packet (LSP)

g
A link state packet can carry a large amount of information. For the moment, however, we assume that
it carries a minimum amount of data:

in
o ID of the node that created the LSP

er
cost of link to each directly connected neighbor
sequence number (SEQNO)

e
o time-to-live (TTL) for this packet

in
The first two, node identity and the list of links, are needed to make the topology. The third, sequence
number, facilitates flooding and distinguishes new LSPs from old ones. The fourth, age,prevents old

ng
LSPs from remaining in the domain for a long time.
LSPs are generated on two occasions:
fE
1. When there is a change in the topology of the domain. Triggering of LSP dissemination is the main
way of quickly informing any node in the domain to update its topology.
2. On a periodic basis. The period in this case is much longer compared to distance vector routing. As a
O
matter of fact, there is no actual need for this type of LSP dissemination. It is done to ensure that old
information is removed from the domain.
g e

Flooding of LSPs
$ Aftera node has prepared an LSP, it must be disseminated to all other nodes, not only to its neighbors.
le

The process is called flooding and based on the following:


ol

1. The creating node sends a copy of the LSP out of each interface.
2. A node that receives an LSP compares it with the copy it may already have. If the newly
C

arrived LSP is older than the one it has (found by checking the sequence number), it discards
the LSP. If it is newer, the node does the following:
u

a. It discards the old LSP and keeps the new one.


ad

b. It sends a copy of it out of each interface except the one from which the packet
arrived. This guarantees that flooding stops somewhere in the domain
iln

(b)
m
Ta

D D
B B

(c) (d)

7
<br>

Page 56 of 131

Flooding of link-state packets


(a) LSP arrives at node X; (b) X floods LSP to A and C;
(c) A and C flood LSP to B (but not X); (d) flooding is complete
Formation of Shortest Path Tree: DijkstraAlgorithm :
After receiving all LSPs, each node will have acopy of the whole topology. However, the topology is
not sufficient to find the shortest path to every other node; a shortest path tree is needed.
A tree is a graph of nodes and links; one node is called the root. All other nodes can be reached from
the root through only one single route. A shortest path tree is a tree in which the path between the root
and every other node is the shortest. What we need for each node is a shortest path tree with that node
as the rOot.

g
The Dijkstra algorithm creates a shortest path tree from a graph. The algorithm divides the nodes into

in
two sets: tentative and confirmed .It finds the neighbors of a current node, makes them tentative,
examines them, and if they pass the criteria, makes them permanent.

er
Inpractice, each switch computes its routing table directly from the LSP's it has collected using a

e
realization of Dijkstra's algorithm called the forward search algorithm. Specifically each switch maintains two

in
lists, known as Tentative and Confirmed. Each of these lists contains a set of entries of the form (Destination,

ng
Cost, NextHop)
Algorithm:
Initialize the Confirmed list with an entry for myself; this entry has a cost of 0
fE
Next = node just added to the Confirmed list in the previous step, select its LSP
For each neighbor (Neighbor) of Next,
O
calculate the cost (Cost) to reach this Neighbor as the sum of the cost from myself to
Next and from Next to Neighbor
e

If Neighbor is currently on neither the Confirmed nor the Tentative list, then add
g

(Neighbor, Cost, Nexthop) to the Tentative list, where Nexthop is the direction I go to
le

reach Next
ol

If Neighbor is currently on the Tentative list, and the Cost is less than the currently listed
cost for the Neighbor, then replace the current entry with (Neighbor, Cost, Nexthop)
C

where Nexthop is the direction I go to reach Next


If the Tentative list is empty, stop. Otherwise, pick the entry from the Tentative list with the
u

lowest cost, move it to the Confirmed list, and return to Step 2.


ad

Example:
B
iln

10
m
Ta

D
<br>

Page 57 of 131

Step Confirmed Tentative Comments


1
(D,0,-) Since D is the only new member of the confirmed
list, look at its LSP.
2 (D,0,-) (B,11,B) (C2,C) D's LSP says we can reach B through B at cost 11,
which is better than anything else on either list, so
put it on Tentative list; same forC.
3 (D,0,-) (C.2,C) (B,11,B) Put lowest-cost member of Tentative (C) onto
Confirmed list. Next, examine LSP of newly con
firmed member (C).
(B,S,C) (A,12,C) Cost toreach B through C is 5, so replace (B,11,8).

g
4 (D,0,-) (C,2,C)
C's LSP tells us that we can reach A at cost 12.

in
(D,0,-) (C,2,C) (8,5,C) (A,12,C) Move lowest-cost member of Tentative (B) to

er
Confirmed, then look at its LSP.
6 (D,0,-) (C,2,C) (B,5,C) (A,10,c) Since we can reach A at cost 5 through B, replace

e
the Tentative entry.

in
7 (D,o,-) (C,2,C) (B,5,C) (A, 10,C) Move lowest-cost member of Tentative (A) to
Confirmed, and we are all done.

ng
OSPF(Open Shortest Path First )
fE
O
This is an Interior Gateway Protocol designed by the Internet Engineering Task Force (IETF). This
algorithm scales better than the vector distance algorithms. This Protocol tackles several goals:
e

OSPF includes type of service(ToS) routing. So, you can install multiple routers to a given destination,
g

one for each type of service. When routing a datagram, a router running OSPF uses both the destination
le

address and type of service fields in the IP Header to choose a route.


ol

OSPF provides load balancing. If there are multiple routes to a given destination at the same cost,
C

OSPF distributes traffic over all the routes equally.


OSPF allows for creation of AREA HIERARCHIES. This makes the growth of the network easier and
u

makes the network at a site easier to manage. Each area is self-contained, so, multiple groups within a
ad

site can cooperate in the use of OSPF for routing.


OSPF protocol specifies that all exchanges between the routers be authenticated. OSPF allows variety
iln

of authentication schemes, and even allows one area to choose a different scheme from the other areas.
To accommodate multi-access networks like ethernet, OSPF allows every multi-access network to have
m

a designated router( designated gateway).


Ta

To permit maximum flexibility, OSPF allows the description of a virtual network topology that
abstracts away from details of physical connections.
OSPF also allows for routers to exchange routing information learned from other sites. The message
format distinguishes between information acquired from external sources and information acquired
from routers interior to the site, so there is no ambiguity about the source or reliability of routes.
Messages in OSPF
There are 5 types of messages in OSPF:
<br>

Page 58 of 131

1. Hello message
Allow routers to test if a node is reachable
2. Link State Advertisement (LSA)
Topology information from a router (iLe. LSPs)

3. Link status request (LSR)


Request to another router to determine the status of one or more links
4. Link status update (LSU)
Responses to a link status request message
5. Link status acknowledgement
Used to indicate that the LSUwas received (reliable transfer)

g
Special Features of OSPF

in
Authentication of routing messages: Routing updates is to be authenticated. Early versions of

er
OSPF used a simple 8- byte password for authentication.
Additional hierarchy:OSPF introduces another layer of hierarchy into routing by allowing a

e
domain to be partitioned into areas.
• Load balancing:OSPF allows multiple routes to the sample place to be assigned the same cost

in
and will cause traffic to be distributed evenly over those routes.

ng
OSPF Header Format
8
16 31

Version Type

SourceAddr
fE
Message length
O
Areald

Checksum Authentication type


e

Authentication
g
le

•Arealdis a 32-bit identifier of the area in which the node is located.


ol

•The entire packet, except the authentication data, is protected by a 16-bit checksum.
C

•Authentication type is
0 if no authentication is used;
1, implying a simple password is used
u

2, that a cryptographic authentication checksum


ad

OSPF Link State Advertisement


iln
m
Ta

10
<br>

Page 59 of 131

LS Age Options Type=1


Link-state ID
Advertising router
LS sequence number
LS checksum Length
0Flags 0 Number of links
Link ID

Link data

g
Link type Num _TOS Metric

in
Optional TOS information
More links

er
LS Age is the equivalent of a time to live, expect that it counts up and the LSA expires when the age

e
reaches a defined maximum value.

in
Type field tells us that is a type 1 LSA.
Link stateand the Advertising router field are identical.

ng
LS Sequence numberis used to detect old or duplicate LSAs.
LS Checksumis for error control
Length is the length in bytes of the complete LSA
TOS --type of service information
fE
LSA is represented by a Link ID, some Link Data and a metric. The first two of these fields identify
O
the link
Metric is the cst of the link.
e

Type tells something about the link like point-to-point link.


g
le

METRICS:
ol

> Link costs, or metrics, are known when we execute the routing algorithm. Routers use various metrics
and calculations to determine the best route for a packet to reach its final network destination. One
C

example, which is quite reasonable and very simple, is to assign a cost of 1 to all links-the least-cost
route will then be the one with the fewest hops.
u

> Such an approach has several drawbacks,


ad

First, it does not distinguish between links on a latency basis.


Second, it does not distinguish between routes on a capacity basis,
Third, it does not distinguish between links based on their current load, making it impossible to
iln

route around overloaded links.


The ARPANET was the testing ground for a number of different approaches to link cost calculation.
m

The original ARPANET routing metric measured the number of packets queued for transmission on
Ta

each link.
The second version of ARPANET took both bandwidth and latency as a measure of load. This was done
as follows.
First, cach incoming packet was timestamped with its time of arrival at the router
(ArrivalTime); its departure time from the router (DepartTime) was also recorded.
Second, when the link-level ACK was received from the other side, the sender node computed
the delay for that packet as
Delay = (depart time - arrival time) + transmissiontime+ link propagation delay
11
<br>

Page 60 of 131

whereTransmission Time and Latency were statically defined for the link and captured the
link's bandwidth and latency, respectively.
(DepartTime- ArrivalTime) represents the amount of time the packet was delayed (queued) in
the node due to load. If the ACK did not arrive, but instead the packet timedout, then
DepartTime was reset to the time the packet was retransmitted.
In this case,DepartTime- ArrivalTime captures the reliability of the link the more frequent
the retransmission of packets, the less reliable the link, and the mnore we want to avoid it.
Finally, the weight assigned to each link was derived from the average delay experiencedby the
packets recently sent over that link.(Depart time - arrival time) captures queuing length.
If the packet was retransmitted the depart time' is updated with the new one.Repcated

g
transmissions declare the link is unreliable.
> Measurements are averaged over 10 seconds

in
o Update is sent if difference>threshold, or for every 50 seconds

er
> Achieves better network utilization

e
Problems with New Metric:

in
Works well for light to moderate load

ng
Static values dominate
Oscillates under heavy load
Queuing dominates fE
Congested link advertising high cost pushes traffic away => some links temporarily
underutilized during heavy load – 50% given 2 links between 2 nodes
O
Range is too wide
9.6 Kbps highly loaded link can appear 127 times costlier than 56 Kbps lightly loaded link
e

Can make a 127-hop path look better than 1-hop


g

Satellite links penalized, though they'd better suit playback video (high BW, non-delay
le

sensitive)
ol

Revised ARPANET:
The major changes were to compress the dynamic range of the metric considerably, to account for the
C

link type, and to smooth the variation of the metric with time.The smoothing was achieved by several
mechanisms.
u

• First, the delay measurement was transformed to a link utilization, and this number was
ad

averaged with the last reportedutilization to suppress sudden changes.


Second, there was a hard limit on how much themetric could change from one measurement
cycle to the next.
iln

By smoothing the changesin the cost, the likelihood that all nodes would abandon a route at
once is greatly reduced.
m

• The compression of the dynamic range was achieved by feeding the measured utilization, the
link type, and the link speed into a function that is shown graphically inFigure 4.21. Observe
Ta

the following:

A highly loaded link never shows a cost of more than three times its cost whenidle:
The most expensive link is only seven times the cost of the least expensive;
A high-speed satellite link is more attractive than a low-speed terrestrial link;
Cost is a function of link utilization only at moderate to high loads.

12
<br>

Page 61 of 131

> All these factors mean that a link is much less likely to be universally abandoned, since
a threefold increase in cost is likely to make the link unattractive for some paths while letting it remain
the best choice for others.

The slopes, offsets, and breakpoints for the curves in Figure 4.21 were arrived at by a great deal of trial
and error, and they werecarefully tuned to provide good performance.

225

g
uns)

in
9.6-kbps satellite link
(rouing
140

er
9.6-kbps terrestrial link
56-kbps satelite link
metric |56-kbps terrestrial link

e
90

in
New 75
8
60

ng
30

25% 50%
Utilization
75% 100% fE
O
Revised ARPANET routing metric vs Link Utilization
e

SWITCH BASICS
g

Switch
le

A mechanism that allows us to interconnect links to forma large network


multi-input, multi-output device which transfers packets from an input to one or more outputs
A
ol

Block diagram of Switch/Router


C

A 4 x4 Switch
u
ad

Control
processor
iln
m

Switch
Ta

Input Fabric Output


portsports

The control processor is responsible for running the routing protocols(in case of router) and generally
acts as the central point of control of the switch/router. The switching fabric transfers packets from input ports
to output ports. It may have internal buffer space and the ports provide a range of functionality to allow the
router to interface to links of various types (e.g. Ethernet, SONET, etc.).
13
<br>

Page 62 of 131

Types of Switch fabrics


1. Shared bus
2. Shared memory
3. Crossbar

Shared bus
VObus is shared
Bus bandwidth determines the throughput of the switch
A
conventional workstation can be used as a switch

g
A workstation used as a packet switch

in
A general purpose processor used as a packet switch

er
VO bus

e
in
tnterface1

ng
CPU

Memory buslnterface 2 fE
O
Interface 3
Main memory
g e
le

Shared memory
ol

Memory bus is shared


Memory bandwidth determines switch's throughput
C

Packets are written into a memory location by an input port and then read from memory by
output ports
u
ad

Crossbar Switch
A crossbar switch is a matrix of pathways configured to connect any input port to output pot.
4 X 4 crossbar switch
iln
m
Ta

Self-routing fabrie
A special 'selfrouting header is appendedto the packet by the input port after it has determined which
output the packet needs to go to.

Input Switch Output


port fabric port

14
<br>

Page 63 of 131

Original packet header

Input Switch Output


port fabric port

g
in
Self-routing header

eer
Input Switch Output

in
port fabric port

ng
GLOBAL INTERNET fE
ADDRESSING :
An Internet Address is made of four bytes (32 bits) that define a host's connection to a network.
O
NETWORK HOST
e

32 Bits
g

172 . 16 122 204


le

8
8 Bits -8 Bits 8
Bits Bits
ol

1 Byte 1
Byte 1 Byte 1
Byte
C

There are some special IP addresses:


1.Broadcast Addresses They are of two types:
u

.
(i)) Limited Broadcast: It consists of all l's, i.e., the address is 255.255.255.255 It is used only
ad

on the LAN, and not for any external network.


(ii) Directed Broadcast: It consists of the network number + all other bits asl's. It reaches the
iln

router corresponding to the network number, and from there it broadcasts to all the nodes in the
network.
m

2. Network ID =0
It means we are referring to this network and for local bro adcast we make the host ID zero.
Ta

3. Host ID =0
This is used to refer to the entire network in the routing table.
4. Loop-back Address
Here we have addresses of the type 127.0.0.1. It goes down way upto the IP layer and comes back to
the application layer on the same host.

Address Classes
:
The IP specifications divide addresses into the following classes
15
<br>

Page 64 of 131

Class A - For large networks


0 7 bits of the network address 24 bits of host address

-
Class B For medium networks
1
0 14 bits of the network address 16 bits of host address

Class C- For small networks


|11 0 21 bits the network address
of
8 bits of host address

g
Class D - For multi-cast messages ( multi-cast to a "group" of networks )

in
111 0
28 bits for some sort of group address

er
Class E - Currently unused, reserved for potential uses in the future

e
111|1 28 bits

in
There are currently 5 different field lengths patterns, each define a class of addresses. These are designed to

ng
cover the needs of different types of organizations, class A, B, C, D, E.

fE
Class A Range :0.0.0. Oto 127.255.255.255Addresses are numerically the lowest.
Class B Range :128.0.0.0 to 191.255.255.255
O
Class C Range :192.0.0.0 to 223.255.255.255
Class D Range : 224.0.0.0 to 239.255.255.255Itis reserved for multicast address, it allows copy's of a
e

datagram to be passed to a selected group of hosts rather than to a individual host. It is similar to broadcasting.
g

Class E Range : 240.0.0.0 to 255.255.255.255Addresses are reserved for further use the structure of each IP
le

address class.
ol

Decimal Value Maximum Maximum


Class Starts Binary range
Routing
C

with range subnets hosts mask


A 0 00000000-01111111 0-127* 127 16,777,214 255.0.0.0
u

B 10 10000000-10111111 128-191 16,384 65,534 255.255.0.0


ad

C 110 11000000-11011111 192-223 2,097,152 254 255.255.255.0


D
1110 11100000-11101111 224-239
iln

E 111111110000-111 11111 240-255


m

*
The O octet is forbidden in the RFC, and 127 is reserved for loopback testing.
Ta

SUBNETTING :
IP address is 32 bits long.
One portion is net id, another portion is host id.
There exists 2 levels of hierarchy.
Toreach host, first search for network with netid, then search host with host id. So in any organization, if
hosts are to be grouped, it is not possible. Hence the solution for this program is subnetting.

16
<br>

Page 65 of 131

Create another section in the IP


SOLUTION: address called the subnet.

NETWORK SUBNET HOST


Subnettingis the process of dividing a single network into smaller networks. The networks are called
subnetworks such that for the rest of the internet, it is a single network.
To create a subnet address, a network administrator borrows bits from the original host portion and
designates them as the subnet field.
Adding subnetwork creates 3 level hierarchy in IP Address, Net id, subnet id, host id.
Subnet Mask

g
Masking is a process that extracts sub network address from an IP Address ifit is a sub network.

in
Determines which part of an IP address is the network field and which part is the host field

er
Follow these steps to determine the subnet mask:
1. Express the subnetwork IP address in binary form.

e
2. Replace the network and subnet portion of the address with all 1s.

in
3. Replace the host portion of the address with all Os.
4. Convert the binary expression back to dotted-decimal notation.

ng
IP address Class Network fE
Subnetted
O
IP Class Network Subnet Host
g e

Subnet
11 11 11 00000
le

Mask
ol
C

Examples
Boundary level Mask with subnetting
u

Class Mask Address N/w Address & Subnet ID


ad

A 255.255.0.0 15.32.56.7 15.32.0.0


iln

B 255.255.255.0 135.67.13.9 135.67.0.0


m

255.255.255.192 201.34.12.72 201.34.12.64


Ta

Calculating the subnet id from IP address and subnet mask by performing “and' function

17
<br>

Page 66 of 131

Network Subnet Host

IP Host Address
172.16.2.120 10101100 00010000 o0000010 01111000

Subnet Mask
255.255.255.0 11111111 11111111 11111111 o0000000
or /24

g
101011o0 00010000 00000010 o000000o

in
Subnet 172 16 2

er
• = 172.16.2.0

e
Subnet Address
+ Host Address Range = 172.16.2.1 -
172.16.2.254

in
Broadcast Address = 172.16.2.255
Eight bits of subnetting

ng
Subnet mask: 255.255.255.128
Subnet number: 128.96.34.0
fE
128.96.34.15
O
128.96.34.1
e

R1
H1
g
le

128.96.34.130 Subnet mask: 255.255.255.128


Subnet number: 128.96.34.128
ol

128.96.34.139
C

128.96.34.129
H3
u

R2
ad

H2
128.96.33.1
128.96.33.14
iln

Subnet mask: 255.255.255.0


Subnet number: 128.96.33.0
m
Ta

Example of Subnetting

Forwarding Table at Router Rl:

18
<br>

Page 67 of 131

SubnetNumber SubnetMask NextHop


128.96.34.0 255.255.255.1 28 Interface o
128.96.34.128 255.255.255.128 Interface1
128.96.33.0 255.255.255.0 R2

PROBLEM
Design a subnet addressing scheme for our college with one class B address. Individual networks to be

g
supported CSE 2 networks with 300 systems each. Computer center - 2 networks with 500 systems each,

in
ECE-1network with 100 systems, EEE - 1 network with 100 systems, Science Block -1 network with
-

er
100 systems, other Engg faculty 2 networks with 100 systems each, Hostel - 2 networks with 100
systems each. Show the entries to be used at the routers.

e
(16)

in
ng
Selecting any B class address from 128.0.0.0 to 191.255.255.255 as 130.5.0.0 (2)
Subnet Mask for B class: 255.255.0.0 (2)
Given in the problem: Number of subnets = 11
fE
Max number of hosts in a single n/w = 500
So subnet mask: 255.255. 11111100.00000000 (4)
O
(So that the number of subnets can be increased to 64 in future and each can have a maximum of 1024 hosts
with best performance)
g e

Routing Table (8)


le

Description of Given Subnets Sub-net Interface


Subnet- id
ol

Mask connecting
CSE - I: 130.5.0.0 to 130.5.3.255 130.5.0.0
C

CSE
CSE– II: 130.5.4.0 to 1 30.5.7.255 130.5.4.0
CC-I: 130.5.8.0 to 130.5.11.255 130.5.8.0
u

Compute Center
CC-II: 130.5.12.0 to 130.5.15.255 130.5.12.0
ad

ECE -I: 130.5.16.0 to 130.5.19.255 130.5.16.0 ECE


EEE-I: 130.5.20.0 to130.5.23.255 130.5.20.0 EEE
iln

:
Sci 130.5.24.0 to 130.5.27.255 130.5.24.0 Science block
Engg– I: 130.5.28.0 to 130.5.3 1.255 255.255.252.0
m

130.5.28.0 Other Engg.


Engg- II: 130.5.32.0 to130.5.35.255 130.5.32.0 Blocks
Ta

Hostel –I: 130.5.36.0 to 130.5.39.255 130.5.36.0


Hostel
Hostel – II:130.5.40.0 to 130.5.43.255 130.5.40.0

Routing Areas

19
<br>

Page 68 of 131

As a first example of using hierarchy to scale up the routing system, we'll examine how link-state
routing protocols (such as OSPF and IS-IS)can be used to partition a routing domain into subdomains called
areas. (Theterminology varies somewhat among protocols-we use the OSPF terminologyhere.) By adding
this extra level of hierarchy, we enable singledomains to grow larger without overburdening the routing
protocols orresorting to the more complex interdomain routing protocols describedbelow.An area is a set of
routers that are administratively configured toexchange link-state information with each other. There is one
specialarea-the backbone area, also known as area 0. An example of a routingdomain divided into areas is
shown in Figure Routers R1, R2, and R3are members of the backbone area. They are also members of at least
onenonbackbone area; RI is actually a member of both area 1 and area 2.A router that is a member of both the
backbone area and a nonbackbonearea is an area border router (ABR).
Note that these are distinct from therouters that are at the edge of an AS, which are referred to as AS

g
borderrouters for clarity.Routing within a single area is exactly as described .All the routers in the area send

in
link-state advertisements to each otherand thus develop a complete, consistent map of the area. However, the
link-state advertisements of routers that are not area border routers do

er
not leave the area in which they originated. This has the effect of makingthe flooding and route calculation
processes considerably more scalable.For example, router R4 in area 3 will never see a link-state

e
advertisementfrom router R8 in area 1. As a consequence, it will know nothing about thedetailed topology of

in
areas other than its own.

ng
How, then, does a router in one area determine the right next hopfor a packet destined to a network in
another area? The answer to thisbecomes clear if we imagine the path of a packet that has to travel fromone
nonbackbone area to another as being split into three parts. First, it fE
travels from its source network to the backbone area, then it crosses thebackbone, then it travels from the
backbone to the destination network.To make this work, the area border routers summarize routing
informationthat they have learned from one area and make it available in theiradvertisements to other areas.
O
For example, Rl receives link-state advertisements
from all the routers in area l and can thus determine the cost ofreaching any network in area 1. When RI sends
e

link-state advertisementsinto area 0, it advertises the costs of reaching the networks in area 1 muchas if all
g

those networks were directly connected to R1This enables all the area O routers to learn the cost to reach all
le

networks in area 1. The areaborder routers then summarize this information and advertise it into
thenonbackbone areas. Thus, allrouters learn how to reach all networks inthe domain.
ol
C
u

Area 3
Area 1
ad

R9 R7 Area 0
R1 R3
R8
R4
iln

R2
m

Area 2
Ta

RE RS|

A
domain divided into areas

20
<br>

Page 69 of 131

Interdomain Routing (BGP):

Autonomous system
An autonomous system (AS) is a network or a collection of networks that are all managed and
supervised by single entity or organization.
An AS is a a
heterogeneous network typically governed by large enterprise. An AS has many different
subnetworks with combined routing logic and common routing policies. Each subnetwork is assigned a
globally unique 16 digit identification number (known as the AS number or ASN) by the Internet Assigned
Numbers Authority (IANA).

g
Large corporation

in
"Consumer" ISP

er
Peering

e
point
Peering

in
Backbone service provider
point

ng
"Consumer" ISP

"Consumer ISP
Large corporation fE
Small
O
corporation
e

Some large corporations connect directly to one or more of the backbone, while others connect to
g

smaller, non-backbone service providers.


le

Many service providers exist mainly to provide service to "consumers" (individuals with PCs in their
homes), and these providers must connect to the backbone providers
ol

Often many providers arrange to interconnect with each other at a single "peering point"
C

Assumes the Internet is an arbitrarily interconnected set of AS's.


Define localtraffic as traffic that originates at or terminates on nodes within an AS, and transit traffic as
u

traffic that passes through an AS.


ad

We can classify AS's into three types:


Stub AS: an AS that has only a single connection to one other AS; such an AS will only carry
iln

local traffic (small corporation).


Multihoned AS: an AS that has connections to more than one other AS, but refuses to carry
m

transit traffic (large corporation).


Transit AS: an AS that has connections to more than one other AS, and is designed to carry both
Ta

transit and local traffic (backbone providers).

Internet is organized as autonomous systems (AS) each of which is under the controlof a single
administrative entity.
corporation's internal network might be a single AS, as may the network of a single Internet service provider
A

21
<br>

Page 70 of 131

S9R1 R3

R2
Autonomous system 1

g
R4

in
Autonomous system 2

er
9R6

e
in
ng
A network with two autonomous systems
fE
Inter-domain Routing Protocols
O
Exterior Gateway Protocol (EGP)
Forced a tree-like topology onto the Internet
e

Did not allow for the topology to become general


g

Tree like structure: there is a single backbone and autonomous systems are
le

connected only as parents and children and not as peers


Border Gateway Protocol (BGP)
ol

Assumes that the Internet an arbitrarily interconnected set of ASs.


C

Today's Internet consists of an interconnection of multiple backbone networks (they are


usually called service provider networks, and they are operated by private companies
u

rather than the government)


ad

Sites are connected to each other in arbitrary ways


iln

Border Gateway Protocol(BGP) is a distance-vector protocol used to communicate between different


ASes. Instead of maintaining just the cost to each destination, each BGP router keeps track of the exact path
m

used. Similarly, instead of periodically giving each neighbour its estimated cost to cach destination, each BGP
Ta

router tells its neighbours the path it is using. Every BGP router contains a module that examines routes to a
given destination and scores them returning a number for destination to each route. Any route violating a
policy constraint automatically gets a score of infinity. The router adapts a route with shortest distance. The
scoring function is not a part of the BGP protocol and can be any function that the system managerswant.BGP
easily solves the count to infinity problem that plagues other distance-vector algorithms as whole path is
known.

22
<br>

Page 71 of 131

The Border Gateway Protocol(BGP) is the routing protocol used to exchange routing information
across the Internet. It makes it possible for ISPs to connect to each other and for end-users to connect to more
than one ISP. BGP is the only protocol that is designed to deal with a network of the Internet's size, and the
only protocol that can deal well with having multiple connections to unrelated routing domains.

The goal of Inter-domain routing is to find any path to the intended destination that is loop free
We are concerned with reachability than optimality
Finding path anywhere close to optimal is considered to be a great achievement
Scalability: An Internet backbone router must be able to forward any packet destined anywhere in the
Internet

g
Having a routing table that will provide a match for any valid IP address

in
Autonomous nature of the domains

er
It is impossible to calculate meaningful path costs for a path that crosses multiple ASs
A cost of 1000 across one provider might imply a great path but it might mean an unacceptable

e
bad one from another provider

in
Issues of trust

ng
Provider A might be unwilling to believe certain advertisements from provider B
Each AS has:
One BGP speaker that advertises:
local networks
fE
other reachable networks (transit AS only)
O
gives path information
In addition to the BGP speakers, the AS has one or more border "gateways" which need not be the
e

same as the speakers


g

The border gateways are the routers through which packets enter and leave the AS
le

BGP advertises complete paths as an enumerated lists of ASs to reach a particular network
ol
C
u
ad

Example of a network running BGP


iln
m
Ta

23
<br>

Page 72 of 131

Customer P 128.96
(AS 4) 192.4.153
Regional provider A
(AS 2)
Customer Q 192.4.32
(AS 5) 192.4.3
Backbone network
(AS 1)
Customer R
192.12.69
(AS 6)

g
Regional provider B

in
(AS 3)

er
Customer S 192.4.54
(AS 7) 192.4.23

e
in
For this example, let AS1-AS3 be transit AS's and AS4-AS7 are stubs AS's.AS2 would advertise the
networks of P andQ. ASI would advertise all networks received from AS2 to all other AS's it had connection

ng
to. AS3 would then get an advertisement of network 128.96 as being ASI,AS2 Note that in addition to
advertising the routes, the AS also includes other transits AS's in the path. This helps to avoid loops since two
fE
paths to a network with a common AS in the center would not be confused as separate routes. The transit AS's
identifying numbers are thus not random and are assigned by a global authority. Current AS numbers are 16
O
bits in length. Only transit AS's need these unique, non-duplicated numbers. The AS number space was
expanded to 32 bits in 2009 and usage has started so address space will not be a problem.
g e

Speaker for AS 2 advertises reachability to P and Q


Network 128.96, 192.4.153, 192,4.32, and 192.4.3, can be reached directly from AS 2.
le

Speaker for backbone network then advertises


ol

Networks 128.96, 192.4.153, 192.4.32, and 192.4.3 can be reached along the path <AS 1, AS
2>.
C

Speaker can also cancel previously advertised paths


It should be apparent that the AS numbers carried in BGP need to be unique
u

For example, AS 2 can only recognize itself in the AS path in the example if no other AS identifies
ad

itself in the same way


AS numbers are 16-bit numbers assigned by a central authority
iln

Integrating Interdomain and Intradomain Routing


A BGP speaker learns interdomain routing information and it should be informed to all the other
m

routers within the domain.The border router is the only choice for knowing all routes that are outside the AS
and informing the same within the domain.
Ta

So BGP works as two variants, which are


i) iBGP(internal BGP)
ii) eBGP(external BGP)
Allrouters run iBGPalong with an intradomain routing (RIP or OSPF) protocol it runs.Border routers
also run eBGP to know about external networks.

24
<br>

Page 73 of 131

Tolfrom other autonomous


systems

Tolfrom other autonomous


systems

A B

g
in
er
D

e
in
ng
To/from other autonomous
systems
fE
Here is a small example ofa domain with three border routers(A, D, and E). All routers(A,B,C,D & E)
run both iBGP and an intradomain routing protocol. Border routers (A, D, E) also run eBGP to use a unified
picture of the external network so packets destined outside the domain use the best available border router.
O
BGP routing table for AS, IGP routing table of router B, and combined table at router B are shown
below.
g e
le
ol
C
u
ad
iln
m
Ta

25
<br>

Page 74 of 131

Prefix BGP Next Hop Router IGP Path

18.0/16 E A A

12.5.5/24 A

128.34/16 D D

128.69./16 A E

BGP table for the AS IGP table for router

g
B

in
Prefix IGP Path

e er
18.0/16

in
12.5.5/24 A

ng
128.34/16 C

128.69./16
fEA

Combined table for router B


O
Combining the two, router B willsend a packet destined for 18.0/16 to router C on its way to router E,
the border router advertising that route.
g e
le

IPv6
ol

Internet Protocol version 6 (IPv6) is the latest revision of the Internet Protocol (IP), the
C

communication protocol that provides an identification and location system for computers on networks and
routes traffic across the Internet. IPv6 was developed by the Internet Engineering Task Force (IETF) to deal
u

with the long-anticipated problem of IPv4 address exhaustion.


ad

Every device on the Internet must be assigned an IP address in order to communicate with other
devices. With the ever-increasing number of new devices being connected to the Internet, the need arose for
iln

more addresses than IPv4 is able to accommodate. IPv6 uses a 128-bit address, allowing 22, or approximately
3.4x10*8 addresses, or more than 7.9x1028 times as many as IPv4, which uses 32-bit addresses. IPv4 allows
m

only approximately 4.3 billion addresses. The two protocols are not designed to be interoperable, complicating
the transition to IPv6.
Ta

IPv6 is an Internet Layer protocol for packet-switchedinternetworking and provides end-to-end


datagram transmission across multiple IP networks, closely adhering to the design principles developed in the
previous version of the protocol, Internet Protocol Version 4 (IP4). In addition to offering more addresses,
IPv6 also implements features not present in IPv4. It simplifies aspects of address assignment (stateless address
autoconfiguration), network renumbering and router announcements when changing network connectivity
providers. It simplifies processing of packets by routers by placing the need for packet fragmentation into the
end points.
26
<br>

Page 75 of 131

The IPv6 subnet size is standardized by fixing the size of the host identifier portion of an address to 64
bits to facilitate an automatic mechanism for forming the host identifier from link layer addressing information
(MAC address). Network security was a design requirement of the IPv6 architecture, and included the original
specification of IPsec.
IPv6 does not specify interoperability features with IPv4, but essentially creates a parallel, independent
network. Exchanging traffic between the two networks requires translator gateways or other transition
technologies, such as the tunneling protocolsóto4, 6in4, and Teredo.

g
Historical Perspective

in
The IETF began looking at the problem of expanding the IP address spacein 1991, and several alternatives
were proposed. Since the IP address iscarried in the header of every IP packet, increasing the size of the

er
addressdictates a change in the packet header. This means a new version of thelnternet Protocol and, as a
consequence, a need for new software for everyhost and router in the Internet In addition to the need to

e
accommodate scalable routing and addressing, someof the other wish list items for IPng included:

in
Support for real-time services

ng
->Security support
->Autoconfiguration (i.e., the ability of hosts to automaticallyconfigure themselves with such
information as their own IPaddress and domain name) fE
->Enhanced routing functionality, including support for mobile hosts
The IETF appointed a committee called the IPng Directorate to collectall the inputs on IPng requirements and
O
to evaluate proposals for aprotocol to become IPng. Over the life of this committee there were numerous
proposals, some of which merged with other proposals, andeventually one was chosen by theDirectorate to be
e

the basis for IPng. Thatproposal was called Simple Internet Protocol Plus (SIPP). SIPP originallycalled for a
doubling of the IP address size to 64 bits. When the Directorateselected SIPP, they stipulated several changes,
g

one of which wasanother doubling of the address to 128 bits (16 bytes).
le

Addresses and Routing


ol

First and foremost, IPv6 provides a 128-bit address space, as opposedto the 32 bits of version 4. Thus, while
C

version 4 can potentially address4 billion nodes if address assignment efficiency reaches 100%, IPv6
canaddress 3.4x10% nodes, again assuming 100% efficiency. As we haveseen, though, 100% efficiency in
u

address assignment is not likely. Someanalysis of other addressing schemes, such as those of the French
ad

andU.S. telephone networks, as well as that of IPy4, have turned up someempirical numbers for address
assignment efficiency. Based on the mostpessimistic estimates of efficiency drawn fromthis study, the IPv6
addressspace is predicted to provide over 1500 addresses per square foot of theEarth's surface, which certainly
iln

seems like it should serve us well evenwhen toasters on Venus have IP addresses.
m
Ta

Address Space Allocation

27
<br>

Page 76 of 131

Table 4.1 Address Prefix Assignments


for IPv6
Preftx Use
00..0(128 bits) Unspecifed
00...1 (128 bits) Loopback
1111 1111 Multicast addresses
1111 1110 10 Link-local unicast

g
Everything elsze Global Unicast Addresses

in
e er
Address Notation

in
Just as with IPy4, there is some special notation for writing down IPv6addresses. The standard representation

ng
is x:x:x:x:X:X:X:X, where each "x" isa hexadecimal representation of a 16-bit piece of the address. An
examplewould be
47CD:1234:4422:ACO2:0022:1234:A456:0124 fE
Any IPv6 address can be written using this notation. Since there are afew special types of IPv6 addresses, there
are some special notations thatmay be helpful in certain circumstances. For example, an address with alarge
O
number of contiguous Os can be written more compactly by omittingall the 0 fields. Thus,
47CD:0000:0000:0000:0000:0000:A456:0124
e

could be written
47CD::A456:0124
g

Clearly. this formof shorthand can only be used for one set of contiguousOs in an address to avoid
le

ambiguity.The two types of IPv6 addresses that contain an embedded IPv4address have their own special
notation that makes extraction of thelPy4 address easier. For example, the IPy4-mapped IPv6 address of a
ol

hostwhose IPv4 address was 128.96.33.81 could be written as


C

::FFFF:128.96.33.81
That is, the last 32 bits are written in IPv4 notation, rather than as a pairof hexadecimal numbers separated by a
u

colon.Note that the double colonat the front indicates the leading Os.
ad

Global Unicast Address


iln

By far the most important sort of addressing that IPv6 must provide isplain old unicast addressing. It must do
this in a way that supports therapid rate of addition of new hosts to the Internet and that allows routingto be
m

done in a scalable way as the number of physical networks in theInternet grows. Thus, at the heart of IPv6 is
the unicast address allocationplan that determines how unicast addresses will be assigned to serviceproviders,
Ta

autonomous systems, networks, hosts, and routers.In fact, the address allocation plan that is proposed for IPv6
unicastaddresses is extremely similar to that being deployed with CIDR in IPv4.To understand how it works
and how it provides scalability, it is helpfulto define some new terms. We may think of a nontransit AS (i.e.,
astub or multihomed AS) as a subscriber, and we may think of a transit AS
as a provider. Furthermore, we may subdivide providers into direct andindirect. The former are directly
connected to subscribers. The latter primarilyconnect other providers, are not connected directly to
subscribers,and are often known as backbone networks.of routing information to reduce the burden on
intradomainrouters. Again, the key idea is to use an address prefixa set of contiguousbits at the most
28
<br>

Page 77 of 131

significant end of the address-to aggregate reachabilityinformation to a large number of networks and even to
a large number ofautonomous systems. The main way to achieve this is to assign an addressprefix to a direct
provider and then for that direct provider to assign longerprefixes that begin with that prefix to its subscribers
3 125-m-0p
010 Rogistyl| D
ProviderlD SubscriberlD SubnetlD InterfacelD

An IPv6 provider-based unicast address.


Packet Format

g
in
As with many headers, this one starts with a Version field, which is setto 6 for IPv6. The Version field is in the

er
same place relative to the start ofthe header as IPv4's Version field so that header-processing software
canimmediately decide which header format to look for. The TrafficClass andFlowLabel fields both relate to

e
quality of service issues The PayloadLen field gives the length of the packet, excluding the IPv6header,

in
measured in bytes. The NextHeader field cleverly replaces boththe IP options and the Protocol field of IPy4. If
options are required, then they are carried in one or more special headers following the IP header, and this is

ng
indicated by the value of the NextHeader field. If there areno special headers, the NextHeader field is the
demux key identifyingthe higher-level protocol running over IP (e.g., TCP or UDP); that is, it
fE
serves the same purpose as the IPv4 Protocol field. Also, fragmentation isnow handled as an optional header,
which means that the fragmentationrelatedfields of IPy4 are not included in the IPv6 header. The
HopLimitfield is simply the TTL of IPv4, renamed to reflect the way it is actuallyused.
O
Finally, the bulk of the header is taken up with the source and destinationaddresses, each of which is 16 bytes
(128 bits) long. Thus, the IPvheader is always 40 bytes long. Considering that IPv6 addresses are fourtimes
e

longer than those of IPv4, this compares quite well with the IPv4header, which is 20 bytes long in the absence
g

of options.The way that IPvó handles options is quite an improvement over IPv4.In IPv4, if any options were
present, every router had to parse the entireoptions field to see if any of the options were relevant. This is
le

because the options were all buried at the end of the IP header, as an unorderedcollection of htype, length,
ol

valueituples. In contrast, IPv6 treats optionsas extension headers that must, if present, appear in a specific
order. Thismeans that each router can quickly determine if any of the options are relevantto it; in most cases,
C

they will not be. Usually this can be determinedby just looking at the NextHeader field. The end result is that
option processingis much more efficient in IPv6, which is an important factor inrouter performance. In
u

addition, the new formatting of options as extensionheaders means that they can be of arbitrary length, whereas
in IPv4they were limited to 44 bytes at most
ad
iln
m
Ta

29
<br>

Page 78 of 131

4 12 16 24 31
Version TrafficClans FlwLabel

PayloadLen NextHeader HopLimit

SourceAddress

DesinationAddress

g
in
er
Next headerdata

e
in
ng
IPv6 packet header.
fE
Consider the example of the fragmentation header, shown inFigure. This header provides functionality similar
tothefragmentationfields in the IPy4 header described in Section 3.2.2, but it is onlypresent if fragmentation is
O
necessary. Assuming it is the only extensionheader present, then the NextHeader field of the IPv6 header
wouldcontain the value 44, which is the value assigned to indicate the fragmentationheader. The NextHeader
e

field of the fragmentation header itselfcontains a value describing the header that follows it. Again,
g

assumingno other extension headers are present, then the next header mightbe the TCP header, which results in
le

NextHeader containing the value 6,just as the Protocol field would in IPy4.
ol

16 29 31
NextHeader Reseved Ofset RES M
C

Ident
u
ad

IPv6 fragmentation extension header.


iln

Autoconfiguration
m

While the Internet's growth has been impressive, one factor that hasinhibited faster acceptance of the
technology is the fact that getting connectedto the Internet has typically required a fair amount of
Ta

systemadministration expertise. In particular, every host that is connected to the


Internet needs to be configured with a certain minimum amount of information,such as a valid IP address, a
subnet mask for the link to whichit attaches, and the address of a name server. Thus, it has not been possibleto
unpack a new computer and connect it to the Internet withoutsome preconfiguration. One goal of IPv6,
therefore, is to provide supportfor autoconfiguration, sometimes referred to as plug-and-play operation Recall
that IPv6 unicast addresses are hierarchical, and that the leastsignificant portion is the interface ID. Thus, we
can subdivide the autoconfigurationproblem into two parts:
1. Obtain an interface ID that is unique on the link to which the host
30
<br>

Page 79 of 131

is attached.
2. Obtain the correct address prefix for this subnet.
The first part turns out to be rather easy, since every host on a link musthave a unique link-level address. For
example, all hosts on an Ethernethave a unique 48-bit Ethernet address. This can be turned into a validlink
local use address by adding the appropriate prefix from Table 4.1
(1111 1110 10) followed by enough Os to make up 128 bits. For somedevices for example, printers or hosts
on a small routerless network thatdo not connect to any other networks this address may be perfectly
adequate.Those devices that need a globally valid address depend on a routeron the same link to periodically
advertise the appropriate prefix for thelink. Clearly, this requires that the router be configured with the
correctaddress prefix, and that this prefix be chOsen in such a way that there isenough space at the end (e.g., 48
bits)to attach an appropriate link-leveladdress.The ability to embed link-level addresses as long as 48 bits into

g
IPv6addresses was one of the reasons for choosing such a large addresssize. Not only does 128 bits allow the

in
embedding, but it leaves plentyof space for the multilevel hierarchy of addressing
Advanced Routing Capabilities

e er
Another of IPv6's extension headers is the routing header. In the absenceof this header, routing for
IPv6 differs very little from that of IPy4 underCIDR. The routing header contains a list of IPv6 addresses that

in
representnodes or topological areas that the packet should visit en routeto its destination. A topological area

ng
may be, for example, a backboneprovider's network. Specifying that packets must visit this network wouldbe a
way of implementing provider selection on a packet-by-packet basis.Thus, a host could say that it wants some
packets to go through aprovider that is cheap, others through a provider that provides high reliability,
fE
and still others through a provider that the host trusts to providesecurity.
To provide the ability to specify topological entities rather than individualnodes, IPv6 defines an
O
anycastaddress. An anycast address isassigned to a set of interfaces, and packets sent to that address will go
tothe "nearest" of those interfaces, with nearest being determined by therouting protocols. For example, all the
routers of a backbone providercould be assigned a single anycast address, which would be used in therouting
e

header.
g
le
ol

Additonal notes for IPV6


C

Addressing
Compared to IPv4, the most obvious advantage of IPv6 is its larger address space. IPv4 addresses are
u

32 bits ong and number about 4.3x10 (4.3 billion). IPv6 addresses are 128 bits long and number about
ad

3.4x10% (340 undecillion). IPv6's addresses are deemed enough for the foreseeable future.
IPv6 addresses are classified by three types of networking methodologies:
iln

1. Unicast addresses identify each network interface,


2. Anycast addresses identify a group of interfaces, usually at different locations of which the
m

nearest one is automatically selected,


3. Multicast addresses are used to deliver one packet to many interfaces.
Ta

The broadcast method is not implemented in IPv6. Each IPv6 address has a scope, which specifies in
which part of the network it is valid and unique. Some addresses are unique only on the local (sub-network).
Others are globally unique.

Address representation

31
<br>

Page 80 of 131

The 128 bits of an IPv6 address are represented in 8 groups of 16 bits each. Each group is written as 4
hexadecimal digits and the groups are separated by colons (:). The address
2001:0db8:0000:0000:0000:ff00:0042:8329 is an example of this representation.
For convenience, an IPv6 address may be abbreviated to shorter notations by application of the following
rules, where possible.
1. One or more leading zeroes from any groups of hexadecimal digits are removed; this is usually done to
either all or none of the leading zeroes. For example, the group 0042 is converted to 42.
2. Consecutive sections of zeroes are replaced with a double colon (::). The double colon may only be
used once in an address, as multiple uses would render the address indeterminate. RFC 5952

g
recommends that a double colon should not be used to denote an omitted single section of zeroes.

in
An example of application of these rules:
Initial address: 2001:0db8:0000:0000:0000: ff00:0042:8329

er
After removing all leading zeroes: 2001:db8:0:0:0:ff00:42:8329
After omitting consecutive sections of zeroes: 2001:db8::ff00:42:8329

e
The loopback address, 0000:0000:0000:0000:0000:0000:0000:000 1l, may be abbreviated to ::1 by using

in
both rules.

ng
As an IPv6 address may have more than one representation, the IETF has issued a proposed standard
for representing them in text.

IPv6 features
fE
O
128-bit addresses
Multicast
e

I Real-time service
Authentication and security
g

Auto-configuration
le

I End-to-end fragmentation
ol

Enhanced routing functionality, including support for mobile hosts


C

IPy4 vs IPv6:
u

IPv4 Address IPv6 Address


ad

Address Length- 32 bits 128 bits

Address Representation - decimal


iln

hexadecimal

Internet address classes Not applicable in IPv6


m

Multicast addresses (224.0.0.0/4) IPv6 multicast addresses (FF00::/8)


Ta

Class D

Broadcast addresses Not applicable in IPv6

Unspecified address is 0.0.0.0 Unspecified address is ::

Loopback address is 127.0.0.1 Loopback address is ::1

32
<br>

Page 81 of 131

Public IP addresses Global unicast addresses

Private IP addresses (10.0.0.0/8, 172.16.0.0/12, Site-local addresses (FECO::/10)


and 192.168.0.0/16)

Autoconfigured addresses (169.254.0.0/16) Link-local addresses (FE80::/64)

Text representation: Dotted decimal notation Text representation: Colon

Network bits representation: Subnet mask in Network bits representation: Prefix

g
dotted decimal notation or prefix length length notation only

in
DNS name resolution: IPv4 host address (A) DNS name resolution: IPvó host

er
resource record address (AAAA) resource record

e
DNS reverse resolution: IN-ADDR.ARPA DNS reverse resolution: IP6.ARPA

in
domain domain

ng
IPy4 vs IPv6 Header
fE
IPv4 Header IPv6 Header
O
Type of Total Length
Version IHL Service
Version Traffic Class Flow Label
e

Fragment
Indentification Flags
g

Offset
le

Next Hop
Time to Live Protocol Header Checksum Payload Length
Header Limit
ol

Source Address
C

Destination Address

Options Padding Source Address


u

O000 -Field names


ad

kept from IPv4 to IPv6


Legend

not kept in IPv6


|-Fields
- Name &
position changed in IPv6
iln

-
New field in IPv6
Destination Address
m
Ta

1. Fixed Length for the basic header


1. IPy4 header of variable length = min"20 bytes
IPv6 = main header length fixed at 40 bytes
2.
Leads to fast header processing
No need of Header Length (Hd Len) field in IPv4 – obsolete
2. Fragmentation only by traffic source

33
<br>

Page 82 of 131

Source does Path MTU (PMTU) discovery.


1.

2. Freeing routers from having to fragment them


3. No need of IPv4 Identification, Flag, Fragment Offset
3. Header checksums are eliminated
1. IP header checksum recalculated by every node switching the packet due to changing TTL

values, thus taxing router resources.


2. Improvements on L2 technologies and their 32-bit CRC support since the introduction of IPv4
combined with layer 4 checksums provides sufficient protection to make the layer 3 header
checksum unnecessary.

g
3. Packet Header Checksum was eliminated in IPv6 and is in turn enforced at upper layers.

in
IPv6 header fields:

er
1. Version (4 bits)

4 bits are used to indicate the version of IP and is set to 6

e
in
2. Traffic Class (8 bits)
same function as the Type of Service field in the IPv4 header.

ng
3. Flow Label (20 bits)
identifies a flow and it is intended to enable the router to identify packets that should be
fE
treated in a similar way without the need for deep lookups within those packets.
set by the source and should not be changed by routers along the path to destination.
unique & powerful tool to IPv6
O
Can be used with differentiated services (DiffServ) as well as integrated services
e

(IntServ) and Resource ReSerVation Protocol (RSVP2).


g

4. Payload Length (16 bits)


With the header length fixed at 40 bytes, it is enough to indicate the length of the payload to
le

determine the length of the entire packet.


ol

5. Next Header (8 bits)


Indicates either the first extension header (if present) or the protocol in the upper layer PDU
C

(such as TCP, UDP, or ICMPv6).


• When indicating an upper layer protocol above the Internet layer, the same values used in the
u

IPy4 Protocol field are used here.


ad

6. Hop Limit (8 bits)



In IPy6, the IPv4 TTL was appropriately renamed Hop Limit because it is a variable that is
iln

decremented at each hop, and it does not have a temporal dimension.


m

7. Source IPv6 Address (128 bits)


Stores the IPv6 address of the originating host.
Ta

8. Destination IPv6 Address (128 bits)


Stores the IPv6 address of the current destination host.

MULTICAST:
Multicast is grossly defined as sending a single packet to multiple selected destinations. Multicast
supports one to many or many to many communications. Each group has its own IP multicast address. A single
copy of the packet is addressed to group's multicast address.
34
<br>

Page 83 of 131

One-to-many(Source Specific Multicast(SSM)


Radio station broadcast
Transmitting news, stock-price
Software updates to multiple hosts
Many-to-many(Any Source Multicast(ASM)
Multimedia teleconferencing
Online multi-player games
Distributed simulations
Without support for multicast

g
A source needs to send a separate packet with the identical data to each member of the group

in
This redundancy consumes more bandwidth
Redundant traffic is not evenly distributed, concentrated near the sending host

er
Source needs to keep track of the IP address of each member in the group
Group may be dynamic

e
in
Uses of multicasting:

ng
i Sender has no need to know each host's individual Unicast IP address
i. Sender has no need to send multiple copies of packet
iii.
iv.
It eliminates redundant traffic. fE
Routing information can be distributed among routers in internetwork.
Protocols used for maintaining groups:
O
A host signals its desire to join or leavea multicast group by communicating with its local router using
a special protocol
g e

IGMP (Internet Group Management Protocol) [in IPv4]


MLD(Multicast Listener Discovery) [in IPv6]
le

Therefore local routers are responsible for multicasting. So it periodically polls the LAN to determine
ol

groups.
C

MULTICAST ADDRESSES
IP has a subrange of its address space reserved for multicasting. IP provides an IP-level multicastto
u

support many-to-many and one-t0-many communication. Class D IP addresses are used for multicasting. There
ad

are 28 bits of possible multicast addresses in IPv4. Among these 28 bits, lower order 23 bits are mapped to
Ethernet 23 bit multicast addresses. Therefore high order 5 bits are remaining. So only 32(2^5) IP addresses
iln

map into each one of Ethernet addresses. Some subranges of the multicast ranges are reserved for intradomain
multicast, so they can be reused independently by different domains.
m
Ta

MULTICAST ROUTING
It is a process of building multicast forwarding tables, which is otherwise known as multicast
distribution trees.
A router's unicast forwarding tables indicate for any IP address, which link to use to forward the
unicast packet
To support multicast, a router must additionally have multicast forwarding tables that indicate, based on
multicast address, which links to use to forward the multicast packet
35
<br>

Page 84 of 131

Unicast forwarding tables collectively specify a set of paths


Multicast forwarding tables collectively specify a set of trees(ieMulticast distribution trees)
To support source specific multicast, the multicast forwarding tables must indicate which links to use
based on the combination of multicast address and the unicast IP address of the source

MULTICAST ROUTING PROTOCOLS


1. DVMRP (Distance Vector Multicast Routing Protocol)

2. PIM(Protocol Independent Multicast)

g
DVMRP(Distance Vector Multicast Routing Protocol)

in
This is the first multicast routing protocol. Distance Vector Routing for unicast is extended to support
multicast. Since distance vector routers only have NEXTHOP type of data they do not have the full network

er
picture provided by link state routing. It works as a two stage process.

e
Stage 1: Flood
Stage 2:Prune

in
Flood stage:

ng
The packets are first broadcasted to all downstream ports.Each router already knows that shortest path
to source S goes through router NextHop(N) by means of unicast routing table.Whenever it receives multicast

and only if packet arrived from N.


fE
packet from S, the router forwardspacket on all outgoing links (except the one on which the packet arrived), if
O
Eliminate duplicate broadcast packets by only allowing"parent" router for LAN (relative to S) to
forward multicast packets.
Selecting 'parent router for any S
e

It should have shortest path to S (learn via distance vector)


g

smallest address is taken to break ties


le

Reverse Path Broadeast (RPB) or Reverse Path Forwarding


ol

The path is reverse because we consider the shortest path toward the source when making forwarding
C

decisions.
Prune stage:
Goal: Prune networks that have no hosts in group G
u

Step 1: Recognize a leafnetwork with no members in G


ad

A network is leaf if parent is only router on the LAN


determine if any hosts are members of G reside on the network using IGMP
iln

Step Propagate "no members ofG here" information to RP


2:
Router augments(Destination, Cost)pairs update sent to neighbors with set of groups for which
m

this network is interested in receiving multicast packets.


Ta

I This information is propagated from router to router.


So that for each of its links, a given router knows for what groups it should forward multicast packets.
Since routing update is fairly expensive, it only happens when multicast address becomes active.

PIMProtocol Independent Multicast)


PIM was developed in response to the scaling problems of earlier multicast routing protocols. Protocol
Independent' refers that PIM does not depend on any particular sort of unicast routing. PIM divides the
36
<br>

Page 85 of 131

problem space into two modes, depending on the proportion of routers that will want the multicast. The two
modes are
i
dense mode (PIM-DM)
ii. sparse mnode. (PIM-SM)
In PIM-SM, routers explicitly join the multicast distribution tree by sending Join'
messagestoRendezvouspoint (RP)using normal IP unicast transmission.RP is a special router assigned for a
group to manage that group. All routers in a domain know the unicast IP address of RP.A multicast forwarding
tree is built as a result of routers sending 'Join' messages to the RP. Two types of tree are constructed.
i) Shared tree - used by all senders

g
A Join' message clearly must pass through some routers before reaching RP.

in
Each router along the path creates a forwarding table entry (*, G) for the shared tree. *
indicates all senders.

er
ii) -
Source specific tree used only by a specific sending host
Each router along the path also creates a forwarding table entry (S, G) to create

e
sender-specific tree. S indicates the source identified.

in
ng
(a) RP (b) RP
fE
Join
O
R3 R2 R4 R3 R2 R4
e

Join
g

R1,
R5 R1 R5
le
ol
C

(c) RP (d) RP
u
ad

R3 R2 R4 R3/ R2 R4

Join
iln

1Join
Join
R1
m

R1 R5 IR5
Ta

RP=Rendezvous point
Shared tree
-Source-specific tree for source R1

a) & b)Shared Tree c) & d) Source specific tree

37
<br>

Page 86 of 131

a) R4 sends join message to RP and joins shared tree;


b) R5 sends join message to RP and joins shared tree;
c) RP builds source specific tree to RI by sending Join message to RI
d) R4 and R5 builds source specific tree to Rl by sending Join messages to RI

When a router sends a Join message toward the RP for a group G,it is sent using normal IP unicast
transmission. This is illustrated in Figure(a), inwhich router R4 is sending a Join to the rendezvous point for
some group. The initial Join message is wildcarded"; that is, it applies to all senders. A Join message clearly

g
must pass through some sequence of routers before reaching the RP (e.g., R2). Each router along the path looks

in
at the Join and creates a forwarding table entry for the shared tree, called a (*, G) entry (where * means all
senders"). To create the forwarding table entry, it looks at the interface on which the Join arrived and marks

er
that interface as one on which it should forward data packets for this group. It then determines which interface
it will use to forward the Join toward the RP. This will be the only acceptable interface for incoming packets

e
sent to this group. It then forwards the Join toward the RP. Eventually, the message arrives at the RP,

in
completing the construction of the tree branch. The shared tree thus constructed is shown as a solid line from

ng
the RP to R4.
As more routers send Joins toward the RP, they cause new branches to be added to the tree, as illustrated in
Figure (b).Note that, in this case,the Join only needs to travel to R2, which can add the new branch to the tree
fE
simply by adding a new outgoing interface to the forwarding table entry created for this group. R2 need not
forward the Join on to the RP.Note also that the end result of this process is to build a tree whose root is the
RP.At this point, suppose a host wishes to send a message to the group. To do so, it constructs a packet with
O
the appropriate multicast group address as its destination and sends it to a router on its local network known as
the designated router (DR).
e

An important detail to note at this stage is that the Join message sent by the RP to the sending host is
g

specific to that sender, whereas the previous ones sent by R4 and R5 applied to all senders. Thus, the effect
le

ofthe new Join is to create sender-specific state in the routers between the identified source and the RP. This is
referred to as (S, G) state, since it applies to one sender to one group, and contrasts with the (*, G) state
ol

thatwas installed between the receivers and the RP that applies to all senders. Thus, in Figure (c), we see a
source-specific route from RI to the RP (indicated by the dashed line) and a tree that is valid for all senders
C

fromthe RP to the receivers (indicated by the solid line).


Multicast packet is constructed by the sending host with the appropriate multicast group address as its
u

destination and sends it to local router. Then the local router encapsulates the multicast packet inside a PIM
ad

'Register' message and sends to RP. RP receiving this packet looks at the payload of the Register message
and finds inside an IP packet addressed to the multicast address of a group. It transmits the IP packet to all
members of the group.
iln
m
Ta

38
<br>

Page 87 of 131

RP

G
RPG
R3 R2 R4

RPG
R1

g
R5

in
er
G

e
in
ng
Host
Delivery of a packet along a shared tree
fE
Host sends a multicast packet to its local router(Rl). RI tunnels that packet to the RP, which forwards it along
O
the shared tree to R4 and R5.The complete delivery of a packet fromRI to R4 and R5 is shown in Figure.
g e
le

IPy4 Address Classes


ol

In the early days of the Internet, the IANA (Internet Assigned Numbers Authority) defined five classes of public
C

IP addresses as shown below.


u

Ipv4 Address Classes


ad

Class Theoretical Address Range Binary Start Used for


iln

A 0.0.0.0 to 127.255.255.255 0 Very large networks


m

B
128.0.0.0 to 191.255.255.255 10 Medium networks
Ta

C 192.0.0.0 to 223.255.255.255 110 Small networks

D 224.0.0.0 to 239.255.255.255 1110 Multicast

E 240.0.0.0 to 247.255.255. 255 1111 Experimental

39
<br>

Page 88 of 131

Class A IP addresses, where the 1 bit is 0, encompass the range of 0.0.0.0 to


127.255.255.255.This class is for large networks and has 8 bits for network and 24
bits for hosts.

Class B IP addresses, where the 1st two bits are 10, are in the range of 128.0.0.0 to
191.255.255.255. This class is for medium networks and has 16 bits for network and
16 bits for hosts.

g
in
Class C IP addresses, where the 1 three bits are 110, are in the range of 192.0.0.0

er
to 223.255.255.255. This class is for smaller networks and has 24 bits for network
and 8 bits for hosts.

e
in
Class D or multicast IP addresses, where the 1*four bits are 1110 are in the range of

ng
224.0.0.0 to 239.255.255.255.
fE
Class E or experimental IP addresses, where the 1sfour bits are 11110, are in the
range of 192.0.0.0 to 254.255.255.255.
O
g e
le
ol
C
u
ad
iln
m
Ta

40
<br>

Page 89 of 131

UNIT
II
TRANSPORT AND APPLICATION LAYERS
Transport Layer Protocols -UDP and TCP Connection and State Transition Diagram -

Congestion Control and Avoidance (DEC bit, RED)- QoS - Application Layer Paradigms
- -
Client Server Programming Domain Name System – World Wide Web, HTTP, Electronic
Mail
Overview of Transport laver:
The following are some of the common properties that a transport protocol can be expected to provide:
guarantees message delivery

g
delivers messages in the same order they are sent
delivers at most one copy of each message

in
supports arbitrarily large messages

er
supports synchronization between the sender and the receiver
allows the receiver to apply flow control to the sender

e
supports multiple application processes on each host

in
Some of the more typical limitations of the network are that it may

ng
drop messages
reorder messages
deliver duplicate copies of a given message
limit messages to some finite size
fE
deliver me ssages after an arbitrarily long delay
O
The transport protocols provide the following services
e

a simple asynchronous demultiplexing service (UDP )


g

a reliable byte-stream service (TCP)


le

a request/reply service. (RPC)


ol

End-to-End Protocols
C

4.1 SIMPLE DEMULTIPLEXER (UDP):


u

The simplest possible transport protocol is one that extends the host-to-host delivery service of the
ad

underlying network into a process-to-process communication service.


Demultiplexingis allowing multiple application processes on each host to share the network. The
Internet's User Datagram Protocol (UDP) is an example of such a transport protocol.
iln

How does UDP identify the target process?


m

The common approach, and the one used by UDP, is for processes to indirectly identify each other using
Ta

an abstract locator, often called a port or mailbox.


The basic idea is for a source process to send a message to a port and for the destination process to
receive the message from a port.
The header for an end-to-end protocol that implements this demultiplexing function typically contains an
identifier (port) for both the sender (source) and the receiver (destination) of the message.
<br>

Page 90 of 131

0 16 31

SrcPort DstPort

Length Checksum

Data

g
in
Figure 4.1.1 Format for UDP Header

er
How does a process learns the port for the process to which it wants to send a message?
A client process initiates a message exchange with a server process.

e
Once a client has contacted a server, the server knows the client's port (it was contained in the message

in
header) and can reply to it.
How does the client learn the server's port in the first place?

ng
A common approach is for the server to accept messages at a well-known port.
That is, each server receives its messages at some fixed port that is widely published.
fE
For example, the Domain Name Server (DNS) receives messages at well-known port 53 on each host, the
mail service listens for messages at port 25, and the Unix talk program accepts messages at well-known
port 517, and so on.
O
An alternative strategy is to use only a singlewell-known port the one at which the "Port Mapper"
service accepts messages.
e

Aclient would send a message to the Port Mapper's well-known port asking for theport it
g

should use to talk to the "whatever" service, and the Port Mapper returnsthe appropriate
le

port.
This strategy makes it easy to change the port associated withdifferent services over time,
ol

and for each host to use a different port for the sameservice.
A port isimplemented by a message queue, as illustrated in Figure 4.1.2.
C
u

Application Application Application


ProCess Process Process
ad

Ports
iln
m

Queues
Ta

Packets
demultiplexed
UDP

Packets arrive

Figure 4.1.2 UDIP message queue


<br>

Page 91 of 131

When a message arrives,the protocol (e.g., UDP) appends the message to the end of the queue. If
thequeue is full, the message is discarded. There is no flow-control mechanism that tellsthe sender to
slow down.
When an application process wants to receive a message,one is removed from the front of the queue.
If the queue is empty, the process blocksuntil a message becomes available.UDP does not implement
flow control or reliable/ordered delivery,
UDP ensures the correctness of the message by the use ofa checksum.
UDP computes its checksum over the UDP header, the contents of the messagebody, and
something called the pseudoheader.
The pseudoheader consists of three fieldsfrom the IP header
1. protocol number

g
2. source IP address

in
3. destination IP address + the UDP length field.
The pseudoheader is to verify that this message has beendelivered between the correct two

er
endpoints.

e
4.2 Reliable Byte Stream (TCP)

in
ng
The Internet's Transmission Control Protocol (TCP) is probably the most widely used transport protocol
TCP guarantees the reliable, in-order delivery of a stream of bytes.
It is a full-duplex protocol, meaning that each TCP connection supports a pair of byte streams, one
flowing in each direction.
fE
It also includes a flow-control mechanism for each of these byte streams that allows the receiver to limit
how much data the sender can transmit at a given time.
O
Finally, like UDP, TCP supports a demultiplexing mechanism that allows multiple application programs
on any given host to simultaneously carry on a conversation with their peers.
g e

End-to-End Issues
le

At the heart of TCP is the sliding window algorithm.


ol

Even though this is the same basic algorithm because TCP runs over the Internet rather than a point-to
point link, there are many important differences.
C

The sliding window algorithm we already learnt runs over a single physical link that always connects the
same two computers.
u

TCP supports logical connections between processes that are running on any two computers in the
ad

Internet.
This means that TCP needs an explicit connection establishment phase during which the two sides of the
iln

connection agree to exchange data with each other. T


A single physical link that always connects the same two computers has a fixed RTT, TCP connections
m

are likely to have widely different round-trip times.


Variations in the RTT are even possible during a single TCP connection that lasts only a few minutes.
Ta

What this means to the sliding window algorithm is that the timeout mechanism that triggers
retransmissions must be adaptive
Packets may be reordered as they cross the Internet, but this is not possible on a point -to-point link where
the first packet put into one end of the link must be the first to appear at the other end.
Packets that are slightly out of order do not cause a problem since the sliding window
algorithm can reorder packets correctly using the sequence number.
The real issue is how far out-of-order packets can get, or said another way, how late a
packet can arrive at the destination.
TCP also implements a highly tuned flow control and congestion-control mechanisms.
Flow control involves preventing senders from overrunning the capacity of receivers.
<br>

Page 92 of 131

Congestion control involves preventing too much data from being injected into the network, thereby
causing switches or links to become overloaded.
Thus, flow control is an end-to-end issue, while congestion control is concerned with how hosts and
networks interact.

Application process) (Application process

g
Write Read

in
bytes bytes

er
TCP TCP

e
Send buffer Receive buffer

in
ng
Segment SegmentSegment
Transmit segments
fE
Figure 4.2.1 How TCP manages a byte stream.
O
How TCP manages a byte stream?
e

TCP is a byte-oriented protocol, which means that the sender writes bytes into a TCP connection and the
g

receiver reads bytes out of the TCP connection.


le

TCP on the source host buffersenough bytes from the sending process to fill a reasonably sized packet
ol

and then sendsthis packet to its peer on the destination host.


C

TCP Segment Format


u

4 10 16 31
ad

SrcPort DstPort

SequenceNum
iln

Acknowledgment
m

HdrLen Flags AdvertisedWindow


Ta

Checksum UrgPtr

Options (variable)

Data

Figure 4.2.3 TCP header format.


<br>

Page 93 of 131

TCP on the destination host then empties the contents of the packet into a receive buffer., and the
receiving process reads from this buffer at its leisure.
This situation is illustrated in Figure 4.2.1, which, for simplicity, shows data flowing in only one
direction.
A single TCP connection supports byte streams flowing in both directions.
The packets exchanged between TCP peers are called segments since each one carries a segment of the
byte stream.
Each TCP segment contains theheader schematically depicted in Figure 4.2.3.
The SrcPort and DstPort fields identify the source and destination ports, respectively,just as in UDP.
The Acknowledgment, SequenceNum, and Advertised Window fields are all involvedin TCP's sliding

g
window algorithm.

in
Each byte of data has a sequence number; the SequenceNum field contains the sequencenumber for the

er
first byte of data carried in that segment.
The Acknowledgment andAdvertised Windowfields carry information about the flow of data going in the

e
otherDirection
The 6-bit Flags field is used to relay control information between TCP peers.

in
Thepossible flags include SYN, FIN, RESET, PUSH, URG, and ACK.

ng
The SYN and FIN flagsare used when establishing and terminating a TCP connection, respectively.
The ACK flag is set any time the Acknowledgment field isvalid, implying that the receiver should pay
attention to it. fE
The URG flag signifies thatthis segment contains urgent data. When this flag is set, the UrgPtr field
indicates wherethe nonurgent data contained in this segment begins.
O
The PUSH flag signifies that the sender invoked the push operation, whichindicates to the receiving side
of TCP that it should notify the receiving process ofthis fact.
e

The RESETflag signifies that the receiver has become confused-for example, because it receiveda
segment it did not expect to receive-and so wants to abort the connection.
g
le

4.3 TCP Connection Establishment and Termination


ol

A TCP connection begins with a client (caller) doing an active open to a server (callee).
C

Assuming that the server had earlier done a passive open, the two sides engage in an exchange of
messages to establish the connection.
u

Only after this connection establishment phase is over do the two sides begin sending data.
ad

As soon as a participant is done sending data, it closes one direction of the connection, which causes TCP
to initiate a round of connection termination messages.
iln
m
Ta
<br>

Page 94 of 131

Active participant Passive participant


(client) (server)
SYN,
SequenceNum
=x
=y,
SequenceNum
+ACK,
Acknowledgment
=x+ 1
SYN

g
ACK,
Acknowledgment

in
=y +

er
1

e
Figure 4.3.1 Timeline for three-way handshake algorithm.

in
Three-Way Handshake

ng
The algorithm used by TCP to establish and terminate a connection is called a three- way handshake.
fE
The three-way handshake involves the exchange of three messages between the client and the server, as
illustrated by the timeline given in Figure 4.3.1.
First, the client (the active participant)sends a segment to the server (the passive participant) stating the
O
initial sequencenumber it plans to use (Flags = SYN, SequenceNum = x).
The server then respondswith a single segment that both acknowledges the client's sequence number
e

(Flags =ACK, Ack = x+ 1) and states its own beginning sequence number (Flags = SYN,
g

SequenceNum = y). That is, both the SYN and ACK bits are set in the Flags field of this second message.
Finally, the client responds with a third segment that acknowledges the server's sequence number
le

(Flags = ACK, Ack=y+ 1).


ol

The reason that each side acknowledges a sequence number that is one larger than the one sent is that the
Acknowledgment field actually identifies the next sequence number expected."
C

TCP State Transition Diagram


u
ad

TCP state transition diagram is given in Figure 4.3.2.


This diagram shows only the states involvedin opening a connection (everything above ESTABLISHED)
and in closing aconnection (everything below ESTABLISHED). Everything that goes on while a
iln

connectionis open--that is, the operation of the sliding window algorithm-is hidden inthe
ESTABLISHED state.
m
Ta
<br>

Page 95 of 131

CLOSED
Active open/SYN
Passive open Close
Close

LISTEN

SYN/SYN + ACK Send/SYN

g
SYN_RCVD
SYN/SYN+ ACK
SYN_SENT

in
ACK SYN + ACK/ACK

e er
Close/FIN ESTABLISHED

in
FIN/ACK

ng
Close/FIN
FIN_WAIT_1 CLOSE_WAIT
FIN/ACK
|ACK ACK
+FINACK
fE CloseFIN

FIN_WAIT_2 CLOSING LAST_ACK


O
ACK imeout after two ACK
segment lifetimes
FIN/ACK
e

TIME_WAIT CLOSED
g
le

Figure 4.3.2.TCP state transition diagram.


ol

Each circle denotesa state that one end of a TCP connection can find itself in.
Allconnections start in theCLOSED state.
C

Each arc is labeled with a tag of the form event/action.


Thus, ifa connection is in the LISTEN state and a SYN segment arrives (i.e., a segment withthe SYN flag
u

set), the connection makes a transition to the SYN RCVD state and takesthe action of replying with an
ad

ACK + SYN segment.


Now let's trace the typical transitions taken through the diagram in Figure 4.3.2.
iln

When opening a connection, the server first invokes a passive openoperation on TCP, which causes TCP
to move to the LISTEN state.
m

At some later time,the client does an active open, which causes its end of the connection to send a
SYNsegment to the server and to move to the SYN SENT state.
Ta

When the SYN segmentarrives at the server, it moves to the SYN RCVD state and responds with a
SYN+ACKsegment.
The arrival of this segment causes the client to move to the ESTABLISHEDstate and to send an ACK
back to the server.
When this ACK arrives, the server finallymoves to the ESTABLISHED state. In other words, we have
just traced the three-wayhandshake.
Now to the process of terminating a connection, the importantthing to keep in mind is that the application
process on both sides of theconnection must independently close its half of the connection.
If only one side closesthe connection, then this means it has no more data to send, but it is still
availableto receive data from the other side.
<br>

Page 96 of 131

Thus, on any one side there are threecombinations of transitions that get a connection from the
ESTABLISHED state to theCLOSED state:
This side closes first:
ESTABLISHED FIN WAIT 1 FIN WAIT 2 TIME WAIT CLOSED.
The other side closes first:
ESTABLISHED CLOSE WAIT LAST ACK CLOSED.
Both sides close at the same time:
ESTABLISHED FIN WAIT 1 CLOSING TIME WAIT CLOSED.

g
1. 4.4 Adaptive Flow Control : TCP sliding window algorithm for flow control.

in
er
Flow control is preventing the sender from overrunning the capacity of the receiver.
We go back to our sliding window algorithm.

e
in
Sending application

ng
fE
O
TCP TCP
LastByteVWritten LastByteRead
g e
le

LastByteAcked LastByte Sent NextByteExpected LastByteRcyd


ol
C

Relationship between TCP send buffer (a) and receive buffer (b).
u

Sending side :
ad

LastByteAcked< = LastByteSent
LastByteSent< = LastByteWritten
Buffers bytes between LastByteAcked and LastByteWritten
iln

Receiving Side:
LastByteRead<NextByteExpected
m

NextByteExpected< = LastByteRcvd+1
Buffers bytes between NextByteRead and LastByteRcvd.
Ta

Send buffer size: MaxSendBuffer


Receive buffer size:MaxRevBuffer

Both buffers are of some finite size, denotedMax SendBuffer and MaxRevBuffer,
The size of the window sets the amountof data that can be sent without waiting for acknowledgment from
the receiver.
Thus,the receiver throttles the sender by advertising a window that is no larger than theamount of data
that it can buffer.
Observe that TCP on the receive side must keep
<br>

Page 97 of 131

-
LastByteRevd LastByteRead<MaxRevBuffer
to avoid overflowing its buffer.
It therefore advertises a window size of
Advertised Window = MaxRevBuffer-LastByteRevd-LastByteRead)

which represents the amount of free space remaining in its buffer. TCP on the sender side must then
adhere to the advertised window it gets fromthe receiver.
This means that at any given time, it must ensure that
LastByteSent -LastByteAckedsAdvertised Window

g
The sender computes an effective window that limits how much datait can send:
-

in
EffectiveWindow = AdvertisedWindow (LastByteSent -LastByteAcked)
The sender side must also make sure that the localapplication process does not overflow the send buffer,

er
that is,

e
LastByte Written-LastByteAcked<MaxSendBuffer

in
ng
4.5 Adaptive Retransmission

TCP guarantees the reliable delivery of data,hence it retransmits each segment if an ACK is not received
fE
in a certain period of time.
TCP sets this timeout as a function of the RTT it expects between the two ends of the connection. Since
O
TCP can have a wide variety of RTTs, it uses an adaptive retransmission mechanism.
e

Original Algorithm
g

To compute a timeout value between a pair of hosts. This is the algorithm that was originally
le

described in the TCP specification


The idea is to keep a running average of the RTT and then to compute the timeout as a function of
ol

this RTT.
C

Specifically, every time TCP sends a data segment, it records the time. When an ACK for that
segment arrives, TCP reads the time again and then takes the difference between these two times as a
u

SampleRTT.
TCP then computes an EstimatedRTT as a weighted average between the previous estimate and this
ad

new sample. That is,


EstimatedRTT = a xEstimatedRTT + (1 - a) x SampleRTT
iln

The parameter a is selected to smooth the EstimatedRTT.


m

alies between 0.8 and 0.9.


TimeOut = 2 xEstimatedRTT
Ta

Karn/Partridge Algorithm
A flaw was discovered in the above simple algorithm.
The problem was that an ACK does not really acknowledge a transmission; it actually acknowledges
the receipt of data.
It is necessary to know which transmission to associate the ACK with so as to compute an accurate
SampleRTT.
Asillustrated in Figure 4.5, if you assume that the ACK is for the original transmissionbut it was
really for the second, then the SampleRTT is too large (a),
<br>

Page 98 of 131

10

while if youassume that the ACK is for the second transmission but it was actually for the first,then
the SampleRTT is too small (b)
Sender Receiver Sender Receiver

Original Original
transmission transmission
SampleRTT
SampleRTT

Retransmission ACK

Retransmission

ACK

g
in
er
(a) (b)

Figure 4.5 Associating the ACK with (a) original transmission versus(b) retransmission.

e
in
The solution is simple.
Whenever TCP retransmits a segment, itstops taking samples of the RTT; it only measures

ng
SampleRTT for segments that havebeen sent only once.
This solution known as the Karn/Partridge algorithm, after itsinventors.
fE
Their proposed fix also includes a second small change to TCP's timeoutmechanism.
Each time TCP retransmits, it sets the next timeout to be twice the lasttimeout, rather than basing it
on the last EstimatedRTT.
O
That is, Karn and Partridgeproposed that TCP use exponential backoff, similar to what the Ethernet
does.
g e

Jacobson/Karels Algorithm
le

The Karn/Partridge algorithm was introduced at a time when the Internet was sufferingfrom high
levels of network congestion.
ol

Their approach was designed to fix some ofthe causes of that congestion, and although it was an
C

improvement, the congestion wasnot eliminated.


A couple of years later, two other researchersJacobson and Karels-proposed a more drastic
change to TCP to battle congestion.
u

It should be clear how the timeout mechanism is related tocongestion-if you time out too soon, you
ad

may unnecessarily retransmit a segment, which only adds to the load on the network.
The main problem with the original computation is that does not take thevariance of the sample
iln

RTTs into account.


Intuitively, if the variation among samplesis small, then the EstimatedRTT can be better trusted.
m

In the new approach, the sender measures a new SampleRTT as before. It thenfolds this new sample
into the timeout calculation as follows:
Ta

Difference = SampleRTT - EstimatedRTT


EstimatedRTT = EstimatedRTT + (8 x Difference)
Deviation = Deviation + (Difference| Deviation)
where & is a fraction between 0 and 1.

TCP then computes the timeout value as a function of both EstimatedRTT and
Deviation as followS:
TimeOut = u xEstimatedRTT + Q x Deviation
u is typically set to land p is set to 4.
<br>

Page 99 of 131

11

Thus, whenthe variance is small, TimeOut is close to EstimatedRTT; a large variance causes
theDeviation term to dominate the calculation.

4.6 TCP Congestion Control

> The idea of TCP congestion control is for each source to determinehow much capacity is available in
the network, so that it knows how manypackets it can safely have in transit.
Once a given source has this many packets intransit, it uses the arrival of an ACK as a signal that one
of its packets has left thenetwork, and that it is therefore safe to insert a new packet into the network
withoutadding to the level of congestion.
By using ACKs to pace the transmission of packets,TCP is said to be self-clocking.

g
in
Congestion Control Mechanisms

er
1. Additive Increase/Multiplicative Decrease

e
TCP maintains a new state variable for each connection, called CongestionWindow, Which is used by

in
the source to limit how much data it is allowed to have in transitat a given time.
The congestion window is congestion control's counterpart to flowcontrol's advertised window. TCP is

ng
modified such that the maximum number of bytes of unacknowledged data allowed is now the minimum
of the congestion window and the advertised window.
A Effective window is revised as follows: fE
MaxWindow = MIN(Congestion Window, Advertised Window)
EffectiveWindow = MaxWindow - (LastByteSent-LastByteAcked).
O

That is, MaxWindow replaces Advertised Window in the calculation of Effective Window.Thus, a TCP
e

source is allowed to send no faster than the slowest component-thenetwork or the destination hostcan
g

accommodate.
le

The AdvertisedWindow, is sent by the receiving sideof the connection.The TCP source sets the
CongestionWindow based onthe level of congestion it perceives to exist in the network.
ol

This involves decreasing thecongestion window when the level of congestion goes up and increasing the
congestionwindow when the level of congestion goes down.
C

This mechanism iscommonly called additive increase/multiplicative decrease (AIMD).


u

How does the source deternmine that the network iscongested and that it should decrease the
ad

congestion window?
TCP interprets timeouts as a signof congestion and reduces the rate at which it is transmitting.
Specifically, each time atimeout occurs, the source sets Congestion Window to half of its previous value.
iln

Thishalving of the CongestionWindow for cach timeout corresponds to the multiplicativedecrease" part
m

of AIMD.
Although Congestion Window is defined in terms of bytes, it is easiest to understandmultiplicative
decrease if we think in terms of whole packets.
Ta

A For example,suppose the Congestion Window is currently set to 16 packets. If a loss is


detected,CongestionWindow is set to 8.
AA
Additionallosses cause Congestion Window to be reduced to 4, then 2, and finally to 1 packet.
CongestionWindow is not allowed to fall below the size of a single packet, or in TCPterminology, the
maximum segment size (MSS).
We also need to be able to increase the congestion window to takeadvantage of newly available capacity
in the network.
This is the additive increase"'part of AIMD, and it works as follows.
<br>

Page 100 of 131

12

A Every time the source successfully sends a Congestion Window's worth of packets that is, each packet
sent out during the last RTT has been ACKedit adds the equivalent of one packet to
Congestion Window.
A This linear increase is illustrated in Figure 4.6.1.
A Specifically, the congestion window is incremented as follows each time an ACK arrives:
Increment = MSS x (MSS/Congestion Window)
Congestion Window+= Increment

Source Destination

g
in
e er
in
ng
fE
O
g e
le
ol
C
u

Figure 4.6.1 Packets in transit during additive increase, with one packet being addedeach RTT.
ad

That is, rather than incrementing Congestion Window by an entire MSS bytes each RTT, we increment it
iln

by a fraction of MSS every time an ACK is received.


Assuming that each ACK acknowledges the receipt of MSS bytes, then that fraction is
m

MSS/CongestionWindow.
Ta

70
60
-
50
gy
40
30
20
10

1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0
Time (seconds)
<br>

Page 101 of 131

13

A This pattern of continually increasing and decreasing congestion window continues throughout life time
of the connection. If we draw congestion window as a function of time, the curve saw tooth form.
A The two main things to remnember about thatmechanismn are that
(1) timeouts are set as a function of both the averageRTT and the standard deviation in
that average, and
(2) due to the cost ofmeasuring each transmission with an accurate clock, TCP only
samplesthe round-trip time once per RTT (rather than once per packet) using a
coarse-grained (500-ms) clock.

2. Slow Start

g
in
The additive increase mechanism is used whenthe source is operating close to the available capacity
of the network.

er
It takestoo long to ramp up a new TCP connection.

e
Source Destination

in
ng
fE
O
g e
le
ol
C
u
ad
iln
m

Figure 4.6.2 Packets in transit during slow start.


Ta

Slow start is used to increasethe congestion window rapidly from a cold start.
Slow start effectively increases thecongestion window exponentially, rather than linearly.
Specifically, the source starts out by setting CongestionWindow to one packet.
When the ACK for this packet arrives, TCP adds l to CongestionWindow and then
sends two packets.
Upon receiving the corresponding two ACKs, TCP incrementsCongestionWindow by 2-one for
each ACK-and next sends four packets.
The endresult is that TCP effectively doubles the number of packets it has in transit every RTT.
Figure 4.6.2 shows the growth in the number of packets in transit during slow start.
<br>

Page 102 of 131

14

Compare this to the linear growth of additive increase illustrated in Figure 4.6.1.

3. Fast Retransmit and Fast Recovery

Fast retransmit is a heuristic that sometimes triggers the retransmissionof a dropped packet sooner
than the regular timeout mechanism.
The fastretransmit mechanism does not replace regular timeouts; it just enhances that facility.

g
The idea of fast retransmit is straightforward.

in
Every time a data packet arrives atthe receiving side, the receiver responds with an acknowledgment,
even if this sequencenumber has already been acknowledged.

er
Thus, when a packet arrives out of order that is, TCP cannot yet acknowledge the data the packet
contains because earlier datahas not yet arrivedTCP resends the same acknowledgment it sent the last

e
time.

in
Thissecond transmission of the same acknowledgment is called a duplicate ACK.

ng
Whenthe sending side sees a duplicate ACK, it knows that the other side must have receiveda packet out
of order, which suggests that an earlier packet might have been lost.
Since it is also possible that the earlier packet has only been delayed rather than lost,the sender waits until
fE
it sees some number of duplicate ACKs and then retransmitsthe missing packet.
In practice, TCP waits until it has seen three duplicate ACKs beforeretransmitting the packet.
O
e

Sender Receiver
g
le

Packet 1
Packet 2
ol

1
Packet 3 ACK
C

Packet 4 ACK 2
u
ad

Packet 5 ACK 2

Packet 6
iln

ACK 2

ACK 2
m
Ta

Retransmit
packet 3

ACK 6

Figure 4.6.3 Fast retransmit based on duplicate ACKs.


<br>

Page 103 of 131

15

Figure 4.6.3 illustrates how duplicate ACKs lead to a fast retransmit.


In thisexample, the destination receives packets l and 2, but packet 3 is lost in the network.
Thus, the destination willsend a duplicate ACK for packet 2 when packet 4 arrives,again when packet 5
arrives, and so on.
When the sender sees the third duplicate ACK for packet 2 the one sentbecause the receiver had gotten
packet 6it retransmits packet 3.
Note that whenthe retransmitted copy of packet 3 arrives at the destination, the receiver then sends
acumulative ACK for everything up to and including packet 6 back to the source.
When the fast retransmitmechanism signals congestion, it is possible to use the ACKs that are still in
thepipe to clock the sending of packets.
This mechanism, which is called fast recovery,effectively removes the slow start phase that happens

g
between when fast retransmitdetects a lost packet and additive increase begins.

in
For example, fast recovery avoidsthe slow and instead simply cutsthe congestion window in half and
resumes additive increase.

er
In other words, slow start is only used at the beginning ofa connection

e
At all other times, the congestion window is followinga pure additive increase/multiplicative decrease

in
pattern.

ng
4.7 Congestion-Avoidance Mechanisms
fE
Congestion Avoidance is to predict whencongestion is about to happen and then to reduce the rate at
which hosts send data justbefore packets start being discarded.
O
This section describes three different congestion-avoidance mechanisms.
They are DECbit, RED and Source-based Congestion Avoidance.
e

The first two take a similar approach: They put a small amount of additional functionality into the
router to assist the end node in the anticipation of congestion.
g

The third mechanism is very different from the first two: It attempts to avoid congestion purely from
le

the end nodes.


ol

1.
DECbit
C

The first mechanism was developed for use on the Digital Network Architecture (DNA), a
u

connectionless network with a connection-oriented transport protocol.


ad

Each router monitors the load it is experiencing and explicitly notifies the end nodes when congestion
is about to occur.
This notification is implemented by setting a binary congestion bit in the packets that flow through
iln

the router.
The destination host then copies this congestion bit into the ACK it sends back to the source.
m

Finally, the source adjusts its sending rate so as to avoid congestion.


What happens in the router?
Ta

A single congestion bit is added to the packet header.


A router sets this bit in a packet if its average queue length is greater than or equal to
1

at the time the packet arrives.


This average queue length is measured over a time interval that spans the last
busy+idle cycle, plus the current busy cycle. (The router is busy when it is transmitting
and idle when it is not.)
What does the source do to avoid congestion?
The source records how many of its packets resulted in some router setting the congestion bit.
The source maintains a congestion window, just as in TCP, and watches to see what
fraction of the last window's worth of packets resulted in the bit being set.
<br>

Page 104 of 131

16

If less than 50% of the packets had the bit set, then the source increases its congestion window by one
packet.
If50%or more of the last window's worth of packets had the congestion bit
set, then the source decreases its congestion window to 0.875 times the previous value.
The "increase by 1, decrease by 0.875" rule was selected because additive increase/multiplicative
decrease makes the mechanism stable.

2. Random Early Detection (RED)


A second mechanism, called random early detection (RED), is similar to the DECbit scheme in that
each router is programmed to monitor its own queue length, and when

g
it detects that congestion is imminent, to notify the source to adjust its congestion window.

in
RED differs from the DECbit scheme in two major ways.
1. The first is that rather than explicitly sending a congestion notification mnessage to the

er
source, RED is most commonly implemented such that it implicitly notifies thesource
of congestion by dropping one of its packets. The source is, therefore, effectively

e
notified by the subsequent timeout or duplicate ACK.

in
2. The second difference between RED and DECbit is in the details of how RED decides
when to drop a packet and what packet it decides to drop.

ng
When to drop a packet and what packet it to drop?
fE
o Drop each arriving packet with some drop probabilitywhenever the queue length exceeds
some drop level.
This idea is called early randomdrop.
O
The RED algorithm defines the details of how to monitor the queue length andwhen to
drop a packet.
e

REDcomputes an average queuelength.


g

That is, AvgLen iscomputed as


le

AvgLen =(1 -Weight) xAvgLen+Weight x SampleLen


where 0 <Weight <l and SampleLen is thelength of the queue when a sample measurementis made.
ol

Second, RED has two queue length thresholds that trigger certain activity:
C

MinThreshold and MaxThreshold.


a
When packet arrives at the gateway, RED comparesthe current AvgLen with these two thresholds,
u

according to the following rules:


ad

ifAvgLensMinThreshold
queue the packet
iln

ifMinThreshold<AvgLen<MaxThreshold
calculate probability P
m

drop the arriving packet with probability P


Ta

ifMaxThresholdsAvgLen
drop the arriving packet
3.
Source-Based Congestion Avoidance

The general idea of these techniques is to watch for some sign from the networkthat some router's
queue is building up and that congestion will happen soon if nothingis done about it.
For example, the source might notice that as packet queues build upin the network's routers,
there is a measurable increase in the RTT for each successivepacket it sends.
<br>

Page 105 of 131

17

Algorithm 1:
For every two round-trip delays thealgorithm checks to sece
o if the current RTT is greater than the average of the minimumand
maximum RTTs seen so far.
If it is, then the algorithm decreases thecongestionwindow by one-eighth.

Algorithm 2:
The window is adjusted once every tworound-trip delays based on the product
(CurrentWindow - OldWindow) x (CurrentRTT -OldRTT)
If the result is positive, the source decreasesthe window size by one-eighth.

g
If the resultis negative or zero, the source increases thewindow by one maximum packet size.

in
Algorithm 3:

er
For every RTT, the source increasesthe window size by one packetand compares the throughput
achieved tothe throughput when the window was onepacket smaller.

e
If the difference is less thanone-half the throughput achieved when onlyone packet was in

in
transit ,thendecreases the window by one packet.
The throughput is calculated bydividing the number of bytes outstanding inthe

ng
network by the RTT.

4.8 Quality of Service


fE
O
For many years, packet-switched networks have offered the promise of supporting multimedia
applications,that is, those that combine audio, video, and data.
e

There is more to transmitting audioand video over a network than just providingsufficient bandwidth.
,
For example participants in a telephone conversation, expect to be able to converse in such a way that
g

one person can respond to something said by the other and be heard almost immediately.
le

Thus, the timeliness of delivery can be very important.


ol

We refer to applications that are sensitive to the timeliness of data as real-time applications.
The distinguishing characteristic of real-time applications is that they need some sort of assurance
C

from the network that data is likely to arrive on time.


Whereas a non-real-time application(elastic) can use an end-to-endretransmission strategy to make sure
u

that data arrives correctly, such a strategy cannotprovide timeliness.


ad

Timely arrival must be provided by the network itself (the routers), not just at thenetwork edges (the
hosts).
Hence the best-effort model, in whichthe network tries to deliver your data but makes no promises is not
iln

sufficient for real-time applications.


What we need is anew service model, in which applicationsthat needhigher assurances can ask the
m

networkfor them.
The network may then respondby providing an assurance that it willdo better.
Ta

This impliesthat the network will treat some packetsdifferently from otherssomething thatis not done in
the best-effort model.
A networkthat can provide these different levelsof service is often said to support quality ofservice
(QoS).

Taxonomy of Real-Time Applications


<br>

Page 106 of 131

18

Applications

Elastic Real time

g
Intolerant Tolerant

in
e er
Nonadaptive Adapive

in
ng
Rate adapive fE Delay adaptive

Figure 4.8 Taxonomy of Applications


O
The taxonomy of applications is summarized in Figure 4.8
1. Tolerant and Intolerant Real -time Applications
e

The first characteristic by which we can categorize applications is their tolerance of loss of
g

data, where "loss might occur because a packet arrived too late to be played back as well
as arising from the usual causes in the network.
le

For example, one lost audio sample can be interpolated from the surrounding samples
ol

with relatively little effect on the perceived audio quality(can tolerate loss) whereas a
robot control program is likely to be an example of a real-time application that cannot
C

tolerate losslosing the packet that contains the command instructing the robot arm to
stop is unacceptable.
u

Thus, we can categorize real-time applications as tolerant or intolerant depending on


ad

whether they can tolerate occasional loss.

2. Non-adaptive and Adaptive Real -time Applications


iln

A second way to characterize real-time applications is by their adaptability.


m

Forexample, an audio application might be able to adapt to the amount of delay


thatpackets experience as they traverse the network.
Ta

If we notice that packets are almostalways arriving within 300 ms of being sent, then we
can set our playback pointaccordingly.
Suppose that wesubsequently observe that all packets are arriving within 100 ms of being
sent.
If wemoved up our playback point to 100 ms, then the users of the application
wouldprobably perceive an improvement.
The process of shifting the playback point wouldactually require us to play out samples at
an increased rate for some period of time.
Thus, playback point adjustment is fairlyeasy in this case, and it has been effectively
implemented for several voice applications.
<br>

Page 107 of 131

19

3. Rate Adaptive and Delay AdaptiveReal -time Applications


We call applications that can adjust their playback point delay-adaptive applications.
Another class of adaptive applications are rate adaptive.
For example, manyvideo coding algorithms can trade off bit rate versus quality.
Thus, if we find thatthe network can support a certain bandwidth, we can set our coding
parameters accordingly.
If more bandwidth becomes available later, we can change parameters to
increase the quality.

Approaches to QoS Support


Someof the approaches that have been developed to provide a range of qualities of service, are classified into

g
two broad categories:

in
fine-grained approaches, which provide QoS to individual applications orflows
coarse-grained approaches, which provide QoS to large classes of data oraggregated

er
traffic.

e
in
Integrated Services (RSVP)

ng
The term "Integrated Services" (often called IntServ for short) refers to a body ofwork that was produced
by the IETF around 1995-97.
fE
The IntServ working group developed specifications of a number of service classes designed to meet the
needs of some of the application types described above.
It also defined how RSVP could be usedto make reservations using these service classes.
O
1. Service Classes
One of the service classes is designed for intolerant applications.
e

o These applicationsrequire that a packet never arrive late.


g

The network should guarantee that the maximumdelay that any packet will experience has some
specified value.
le

o The applicationcan then set its playback point so that no packet will ever arrive after its
ol

playbacktime.
We assume that early arrival of packets can always be handled by buffering.
C

Thisservice is referred to as the guaranteed service.


o The service that meets the needs of tolerant, adaptive applications is known as controlled load.
u
ad

2. Overview of Mechanisms
a) Flowspec
o We need to tell the network something about what we are going to inject into it, since a low
iln

bandwidth application is going to require fewer network resources than a high-bandwidth


application.
m

o The set of information that we provide to the network is referred to as a flowspec.


There are two separable parts to the flowspec:
Ta

the part that describes the flow's traffic characteristics (called the TSpec)
and the part that describes the service requested from the network (the RSpec).
o The RSpec is very service specific.
o The TSpec is a little more complicated. We needto give the network enough information about
the bandwidth used by the flow to allowintelligent admission control decisions to be made.
For Example,
• Suppose that we have 10 flows that arrive at a switch on separate input ports and that all leave on
the same 10-Mbps link.
Assume that over some suitably long interval each flow can be expected to send no more than 1

Mbps.
<br>

Page 108 of 131

20

You might think that this presents no problem.


However, if these are variable bit rate applications, such as compressed video, then they will
occasionally send more than their average rates.
If enough sources send at above their average rates, then the total rate at which data arrives at the
switch will be greater than 10 Mbps.
This excess data will be queued before it can be sent on the link.
The longer this condition persists, the longer the queue will get.
Packets might have to be dropped, and even if it doesn't come to that, data sitting in the queue is
being delayed.
If packetsare delayed long enough, the service that was requested will not be provided.
One way to describe thebandwidth characteristics of sources is called a token bucket filter.

g
Such a filter isdescribed by two parameters: a token rate r and a bucket depth B. It works as

in
follows.

er
o To be able to send a byte, Imust have a token.

e
To send a packet of length n, I needn tokens.
I start with no tokens
andIaccumulate them at a rate of r per second.

in
Ican accumulate no more than B tokens.

ng
What this means is that I can send a burstof as many as B bytes into the network as fast as
Iwant, but over a sufficiently longinterval, I can't send more than r bytes per second.
It turns out that this informationis very helpful to the admission control algorithm when it
fE
tries to figure out whetherit can accommodate a new request for service.
b) Admission Control
O
For example, if 10 usersask for a service in which each will consistently use 2 Mbps of link
capacity, and theyall share a link with 10-Mbps capacity, the network will have to say no to
some ofthem.
e

The process of deciding when to say no is called admission control.


g

The idea behind admission control is simple.


le

o When some new flow wants to receive a particular level of service, admission control looks at
the TSpec and RSpec of the flow and tries to decide if the desired service can be provided to
ol

that amount of traffic, given the currently available resources, without causing any previously
admitted flow to receive worse service than it had requested.
C

If it can provide the service, the flow is admitted; if not, then it is denied.
The hard part is figuring out when to say yes and when to say no.
u

o Admission control is very dependent on the type of requested service and on the queuing
ad

discipline employed in the routers.


iln

c) Resource Reservation
o The mechanism by which the users of the network and the components of the network itself
m

exchange information such as requests for service, flowspecs, and admission control decisions
is called resource reservation.
Ta

It is achieved using a Resource Reservation Protocol.

d) Packet Scheduling

Finally, when flows and their requirements have been described, and admissioncontrol
decisions have been made, the network switches and routers need to meet therequirements of
the flows.
<br>

Page 109 of 131

21

o A key part of meeting these requirements is managing theway packets are queued and
scheduled for transmission in the switches and routers.
This last mechanism is packet scheduling.

Differentiated Services
The Integrated Services architecture allocates resources to individual flows, the Differentiated Services
model (often called DiffServ for short) allocates resources to a small number of classes of traffic.
• In fact, some proposed approaches to DiffServ simply divide traffic into two classes.
Suppose that we have decided to enhance the best-effort service model by adding

g
• just one new class, which we'll call “premium."

in
Clearly, we will need some way to figure out which packets are premium and which are regular old best
effort.

er
This could obviously be done by using a bit in the packet headerif that bit is a 1, the packet is a
premium packet; if it's a 0, the packet is best effort.

e
in
Who sets the premium bit, and under what circumstances?

ng
The router at the edge of anlnternet service provider's network might set the bit for
packets arriving on an interfacethat connects to a particular company's network. The
fE
Internet service provider mightdo this because that company has paid for a higher level of
service than best effort.
O
What does a router do differently when it sees a packet with the bit set?
e

The Differentiated Services working group of the IETF is standardizing a set of


g

routerbehaviors to be applied to marked packets. These are called “per-hop behaviors".


(PHBS), a term that indicates that they define the behavior of individual routers ratherthan
le

end-to-end services.
ol
C
u
ad
iln
m
Ta
<br>

Page 110 of 131

22

TRADITIONAL APPLICATIONS
* First distinguish between application programs and application protocols. For example, the Hyper Text Transport
Protocol (HTTP) is an application protocol that is used to retrieve Web pages from remote servers. There can be
many different application programs--that is, Web clients like Internet Explorer, Mosaic, and Netscape-that
provide users witha different look and feel, but all of them use the same HTTP protocol to communicate with Web
servers over the Internet.
The most popular applications that are directly invoked by users are the World Wide Web and email.
* Request / Reply paradigm is used by applications (i-e) users send requests to servers, which then respond
accordingly.
3 Applications need their own protocols. Widely-used, standardized application protocols are:
SMTP: Simple Mail Transfer Protocol is used to exchange electronic mail.

g
MIME: (Multipurpose Internet Mail Extensions) define the format of email messages.

in
HTTP: Hyper Text Transport Protocol is used to communicate between Web browsers and Web

er
servers. It is a protocol for fetching Web pages.
HTML: (Hyper Text Markup Language) is a companion specification that defines the form of those pages.

e
I DNS: Domain Name System protocol is used to query name servers and send the responses.

in
I SNMP: Simple Network Management Protocol is used to query (and Sometimes modify) the state of
remote network nodes.

ng
MIB: Management information base defines the variables that can be queried.
ELECTRONIC MAIL (SMTP, POP3, IMAP, MIME) fE
Email is one of the oldest network applications. It is important to
(1) Distinguish the user interface (i.e. your mail reader) from the underlying message transfer protocol
O
(SMTP or IMAP)
(2) Distinguish between this transfer protocol and a companion protocol (RFC 822 and MIME) that
e

defines the format of the messages being exchanged


g
le

Message Format: MIME: (Multipurpose Internet Mail Extensions)


RFC 822 defines messages to have two parts: a header and a body. Both parts are represented in ASCII text.
ol

Originally, the body was assumed to be simple text.


C

This is still the case, although RFC 822 has been augmented by MIME to allow the message body to carry all
sorts of data.
This data is still represented as ASCII text, but because it may be an encoded version of, say a JPEG image, it's
u

not necessarily readable by human users.


ad

The message header is a series of <CRLF> terminated lines.(<CRLE> stands for carriage-return + line-feed,
which are a pair of ASCII control characters often used to indicate the end of a line of text.)
The header is separated from the message body by a blank line. Each header line contains type and value
iln

separated by a colon. Many of these header lines are familiar to users since they are asked to fill them out when
they compose an email message.
m

For example, the To: header identifies the message recipient, and the Subject: header says something about the
purpose of the message.
Ta

Other headers are filled in by the underlying mail delivery system. Examples include Date: (when the message
was transmitted).From: (what user sent the message), and Received: (each mail server that handled this message).
There are, of course ,many other header lines; These header lines describe, in various ways, the data being
carried in the message body. They include
a. MIME-Version: (the version of MIME being used),
b. Content-Description: (a human readable description of what's in the message, analogous to the Subject:
line),
c. Content-Type: the type of data contained in the message), and
d. Content-Transfer-Encoding (how the message body is encoded)
<br>

Page 111 of 131

23

The second piece is definitions for a set of content types (and subtypes).For example; MIME defines two
different still-image types, denoted image/gif and image/jpeg, each with the obvious meaning.
As another example, text/plain refers to simple text you might find in a vanilla 822-style message, while text/
richtext denotes a message that contains marked up" text (text using special fonts, italics, etc).
As a third example, MIME defines an application type, where the subtypes correspond to the output of different
application programs (e.g., application/postscript and application/'msword).
MIME also defines a multipart type that says how a message carrying more than one data type is structured. This
is like a programming language that defines both base types (e.g., integers and floats) and compound types (e.g..
structures and arrays).
One possible multipart subtype is mixed ,which says that the message contains a set of independent data pieces
in a specified order. Each piece then has its own header line that describes the type of that piece.
The third piece is a way to encode the various data types so they can be shipped in an ASCII email message. The

g
problem is that for some data types(a JPEG image, for example),any given 8-bit byte in the image might contain
one of 256 different values. Only a subset of these values are valid ASCII characters .

in
It is important that email messages contain only ASCII, because they might pass through a number of

er
intermediate systems (gateways, as described below) that assume all email is ASCII and would corrupt the
message if it contained non-ASCII characters.

e
To address this issue, MIME uses a straightforward encoding of binary data into the ASCII character.
The encoding is called base64.The idea is to map every three bytes of the original binary data into four ASCII

in
characters .This is done by grouping the binary data into 24-bit units, and breaking each such unit into four 6-bit

ng
pieces
Each 6-bit piece maps onto one of 64 valid ASCII character; for example, 0 maps onto A, 1 maps onto B, and so
on. If you look at a message that has been encoded using the base 64 encoding scheme, you will notice only the 52
fE
uppercase and lowercase letters ,the 10 digits through 0 to9 ,and the special characters + and /.These are the first 64
values in the ASCII character set.
O
Message Transfer:
SMTP is the protocol used to transfer messages from one host to another. To place SMTP in the right
e

context, we need to identify the key players. First, users interact with a mail reader when they compose, file,
g

search, and read their email. There are countless mail readers available, just like there are many web browsers
le

now include a mail reader. Second, there is a mail daemon running on each host.
You can think of this process as playing the role of a post office: mail readers give the daemon
ol

messages they want to send to others users, the daemon uses SMTP running over TCP to transmit the message
C

into a daemon running on another machine, and the daemon puts incoming messages into the user's mailbox.
Since SMTP is a protocol that anyone could implement, in theory there could be many different implementations
u

of the mail daemon. It runs out, though that the mail daemon running on most hosts is derived from the send mail
ad

program originally implemented on berkely UNIX.


iln

MAIL MAIL
READER READER
m

MAIL
GATEWAY
Ta

MAIL MAIL MAIL


DAEMON DAEMON DAEMON

SMTP / TCP SMTP/ TCP

Sequence of mail gateways store and forward email message


<br>

Page 112 of 131

24

While it is certainly possible that the send mail program on a sender's machine establishes an
SMTP/TCP connection to the send mail program on the recipient's machine, in many cases the mail traverses
one or more mail gateways on its route from the sender's host to the receiver's host. Like the end hosts, these
gateways also run a send-mail process. It's not an accident that these intermediate nodes are called "gateways"
since their job is to store and forward email messages.

Mail Reader:

g
The final step is for the user to actually receive her messages from the mail box, read them, reply to

in
them, and possibly save a copy for future reference .The user performs all the actions by interacting with a mail

er
reader. In many cases ,this reader is just a program running on the same machine as the user's mailbox resides, in
which case it simply reads and writes the file that implements the mailbox
.

e
In other cases ,the user accesses her mailbox from aremote machine using yet another protocol, such as

in
the Post Office Protocol(POP) or the Internet Message Access Protocol(IMAP).

ng
IMAP- Internet Message Access Protocol
fE
IMAP is similar to SMTP in many ways .It is a client/server protocol running over TCP, where the
client (running on the user's desktop machine) issues commands in the form of <CRLF> terminated ASCII text
lines and the mail server(running on the machine that maintains the user's mailbox) responds in-kind.
O
The exchange begins with the client authenticating herself, and identifying the mailbox she wants to
access. This can be represented by the simple state transaction diagram shown in the figure. In this diagram,
e

LOGIN, AUTHENTICATE, SELECT, EXAMINE, CLOSE and LOGOUT are example commands that the
g

client can issue, while OK is one possible server response. Other common commands include FETCH, STORE,
le

DELETE, and EXPUNGE, with the obvious meanings. Additional server responds include NO (client does not
ol

have permission to perform that operation) and BAD (command is ill-formed).


When the user asks to FETCH a message, the server returns it in MIME format and the mail reader
C

decodes it. In addition to the message itself, IMAP also defines a set of message
u

attributes that are exchanged as part of other commands, independent of transferring the message itself.
ad
iln
m
Ta
<br>

Page 113 of 131

25

Connection established

Server greeting

|(1) (2) (3)

Not authenticated

(7) (4)

Authenticated

g
(7) (5) (6)

in
Selected

e er
Logout

in
ng
Both sides close the connection

(1)
(2)
(3)
fE
Connection without preauthentication (OK greeting)
Preauthenticated connection (PREAUTH greeting)
Rejected connection (BYE greeting)
(4) Successful LOGIN or AUTHENTICATE Command
O
(5) Successful SELECT or EXAMINE Command
(6) CLOSE command, or failed SELECT or EXAMINE command
LOGOUT command, server shutdown, or connection closed
e

(7)
IMAP State Transition Diagram
g
le

Message attributes include information like the size of the message, but more interestingly, various
ol

flags associated with a message, such as Seen, Answered, Deleted and Recent. These flags are used to keep the
client and server synchronized, that is, when the user deletes a message in the mail reader:, the client needs to
C

report this fact to the mail server. Later, should the user decide to expunge all deleted messages, the client issues
an EXPUNGE command to the server, which knows to actually remove all earlier deleted messages from the
u

mail box.
ad

Finally, note that when the user replies to a message, or sends a new message, the mail reader does not
forward the message from the client to the mail server using IMAP, but it instead uses SMTP .This means that
iln

the user's mail server is effectively the first mail gateway traversed along the path from the desktop to the
recipient's mail box.
m

SMTP Commands: SMTP operations are executed using a series of commands and responses exchanged
Ta

between SMTP server and receiver. Each command consists of a single line text – beginning with 4 letter
command code followed by argument
Command Description

HELO<space><domain><CRL> send identification

MAIL<sp> FROM Originator identity


<rev.path><CRLE>
<br>

Page 114 of 131

26

RCPT<sp> TO <forward receiver's identity


path><CRLF>

NOOP <CRLF> No operation

DATA <CRLF> Transfer message

Three Phases of SMTP:


1. Connection Setup:Those who wants to send mails to others
Open a TCP connection with server

g
Receiver sends “220 service ready"

in
Sender sends HELO to identity itself

er
Receiver accepts with "250 okay"

e
2. Mail Transfer: After establishing the connection, SMTP sender sends messages as

in
MAIL command identifying originator of message

ng
RCPT commands identifying recipients of message
DATA command transfers message
S
R:
MAIL FROM abc yahoo.com
250 ok
@
fE
RCPT TO xyz @annauniv.edu
O
S:
R: 250 ok
e

DATA
354 start
g

R:
S:
le

3. Connection closing:
ol

Sender sends QUIT command and waits for reply


C

TCP FIN close is operated


Receiver after sending reply issue QUIT
u
ad

Need of MIME: (Multipurpose Internet Mail Extension)


MIME converts binary files, executed files into text files. Then only it can be transmitted using
iln

SMTP
SMTP cannot transmit text data including national language characters. MIME translates all these
m

non ASCII codes to SMTP7 bit ASCIIcode


-
Messages more than certain size can be translated by MIME into SMTP acceptable size
Ta

MIME is needed to transfer audio and video through SMTP (i.e.) non text data
<br>

Page 115 of 131

27

Audio application
Domino

Mail
message text types
Image non-ASCI,
rich text

multipart message Video

g
in
Complex MIME message content types

e er
in
ng
POP- Post Office Protocol
fE
Post Office Protocol, version3 (POP3) and Internet Mail Access Protocol version4
O
(IMAP4) are protocol used by a mail server in conjunction with SMTP to receive and hold mail for hosts.
e

Functions of POP3.
g

Sends a timestamp that is stored internally


le

Sends a command string to a POP3 server and connects to a POP3 server.


ol

Marks the mailwith number nMsg as deleted.


C

Sends the LIST command to the server, which responds with a maildrop.
u
ad

Sends the No Operation command to the server.

Sends the password as plain ASCI text to the server.


iln

Sends the Quit command to the server.


m

Retrieves a standard single-line response from the POP3 server.


Ta

Retrieves a multi-line response from the POP3 server.

Retrieves a message with number nMsg from the server.

Invokes a rollback on the POP3 server. The server then performs an undo on message deletion.

Shuts down the connection to the POP3 server. First commit the changes on the server.

Retrieves the mailbox status after a successful login.


<br>

Page 116 of 131

28

Retrieves from the server the first nLines lines of the mail with number nMsg.

Retrieves from the server a unique message ID string for message nMsg.

Sends the mailbox user name to the server.

POP3 – Post Office


Protocol

g
in
SMTP internet msg transfer

er
agent pop3 server user agent
pop3

e
in
ng
dial up connection
Sending
Host
mailbox ISP's
machine
fE user's pc
O
10/08/2010 POP3 & IMAP 7
g e
le
ol

POP3 protocol
S: +0K POP3 server ready
C

C: user alice
aut horization phase S: +0K
C: pass hungry
O cient commands:
S: +0K user successtully logged on
u

o user:declare username C: list


O pass: password
ad

S: 1 498
O server responses S: 2 912
S:
O+0K
C: retr 1
9-ERR Cmessage 1 contents>
iln

transaction phase,client: S:
C: dele 1
O
list: list message numbers C: retr 2
retr: retrieve message by
m

D Kmessage 1 contents>
number
C: dele 2
O dele: delete
Ta

C quit
O quit S +OK POP3 server signing off

HTTP(HYPERTEXT TRANSFER PROTOCOL)-World Wide Web(WWw)

The Hypertext Transfer Protocol (HTTP) is a protocol used mainly to access data on the World Wide
Web. The protocol transfer all data in the form of plain text, hypertext, audio, video, and so on. However it is
<br>

Page 117 of 131

29

called the hypertext transfer protocol because its efficiency allows its use in a hypertext environment where there
are rapid jumps from one document to another.
HTTP functions ike a combination of FTP and SMTP. It is similar to FTP because it transfers files and
uses the services of TCP. However, it is much simpler than FTP because it uses only data are transferred
between the client and the server.
HTTP is like SMTP because the data transferred between the client and server look like SMTP messages.
In addition, the format of the messages is controlled by MIME-like headers.
However, HTTP differs from SMTP in the way the messages are sent from the client to the server and
from the server to the client. Unlike SMTP, the HTTP messages are not destined to be read by humans; they are
read and interpreted by the HTTP server and HTTP client (browser). SMTP messages are stored and forwarded,

g
but HTTP messages are delivered immediately.

in
The idea of HTTP is very simple. A client sends a request, which looks like mail, to the server. The

er
server sends the response, which looks like a mail reply, to the client. The request and response messages carry
data in the form of a letter with MIME-like format.

e
The commands from the client to the server are embedded in a letter like request message. The contents

in
of the requested file or other information are embedded in a letter like response message.

ng
The core idea of hypertext is that one document can link to another document, and the protocol
(HTTP) and document language (HTML)were designed to meet that goal.
One helpful way to think of the Web is as a set of cooperating clients and servers, all of whom
fE
speak the same language: HTTP.
Most people are exposed to the Web through a graphical client program, or Web browser, like
O
Safari, Chrome, Firefox or Internet Explorer.
Clearly, if you want to organize information into a system of linked documents or objects, you
e

need to be able to retrieve one document to get started.


g

Hence, any Web browser has a function that allows the user to obtain an object by "opening a
le

URL."
URLs (Uniform Resource Locators) are so familiar to most of us by now that it's easy to forget
ol

that they haven't been around forever.


C

They provide information that allows objects on the Web to be located, and they look like the
following:
u

http://www.cs.princeton.edu/index.html
ad

If you opened that particular URL, your Web browser would open a TCP connection to the Web
server at a machine called www.cs.princeton.edu and immediately retrieve and display the file
iln

called index.html.
Most files on the Web contain images and text and many have other objects such as audio and
m

video clips, pieces of code, etc.


They also frequently include URLs that point to other files that may be located on other machines,
Ta

which is the core of the hypertext" part of HTTP and HTML.


When you ask your browser to view a page, your browser (the client) fetches the page from the
server using HTTP running over TCP.
Like SMTP, HTTP is a text oriented protocol.
At its core, HTTP is a request/response protocol, where every message has the general form
START_LINE <CRLF>
MESSAGE_HEADER <CRLE>
<CRLE
<br>

Page 118 of 131

30

MESSAGE_BODY <CRLF>
where as before,<CRLF>stands for carriage-return-line-feed.The first line (START LINE)
indicates whether this is a request message or a response message.

Messages
There are two general types of HTTP messages, shown in figure request and response. Both message
types follow almost the same format.

Request Messages
A request message consists of a request line, headers, and sometimes a body.

g
The first line of an HTTP request message specifies three things:

in
i. operation to be performed,

er
ii. Web page the operation should be performed on, and
iii. version of HTTP being used.

e
Although HTTP defines a wide assortment of possible request operations- including

in
"write" operations that allow a Web page to be posted on a server the two most common
operations are GET (fetch the specified Web page) and HEAD (fetch status information

ng
about the specified Web page).
HTTP request operations
fE
Operation Description
OPTIONS Request information about available options
O
GET Retrieve document identified in URL
HEAD Retrieve metainformation about document identified in URL
e

POST Give information (e.g., annotation) to server


g

PUT Store document under specified URL


le

DELETE Delete specified URL


request message
ol

TRACE Loopback

CONNECT For use by proxies


C

Response Message
u

A response message consists of a status line, headers, and sometimes a body.


ad

Likerequest messages, response messages begin with a single START LINE.


In this case, the line specifies the version of HTTP being used, a three-digit code
iln

indicating whether or not the request was successful, and a text string giving the
reason for the response.
m

Code Type Example Reasons


Ta

1xx Informational request received, continuing process

2xx Success action successfully received, understood, and accepted


3XX Redirection further action must be taken to complete the request
4XX Client Error request contains bad syntax or cannot be fulfilled
5XX Server Error server failed to fulfill an apparently valid request
<br>

Page 119 of 131

31

Five types of HTTP result codes

World Wide Web

The World Wide Web has been so successful and has made the Internet accessible to so many
people that sometimes it seems to be synonymous with the Internet.
In fact, the design of the system that became the Web started around 1989, long after the Internet
had become a widely deployed system.
The original goal of the Web was to find a way to organize and retrieve information, drawing on
ideas about hypertextinterlinked documentsthat had been around since at least the 1960s.

g
Hypertext and Hypermedia

in
The WWW uses the concept of hypertext and hypermedia. In a hypertext environment, information is stored in a

er
set of documents that are linked together using the concept of pointers. An item can be associated with another
document using a pointer.
The reader who is browsing through the document move to other documents by choosing (clicking) the items that

e
are linked to other documents. Figure shows the concept of hypertext.

in
Whereas hypertext documents contain only text, hypermedia documents can contain pictures, graphics, and sound.
A unit of hypertext or hypermedia available on the Web is called a page. The main page for an organization or an

ng
individual is known as a homepage.

Uniform Resource Identifiers


A
fE
character string that identifies a resource, where a resource can be anything
URI is a
that has identity, such as a document, an image, or a service.
O
The format of URIs allows various more-specialized kinds of resource identifiers to be
incorporated into the URI space of identifiers.
e

I The first part of a URI is a scheme that names a particular way of identifying a certain
g

kind of resource, such as mailto for email addresses or file for file names.
le

The second part ofa URI, separated from the first part by a colon, is the scheme-specific part.
ol

Uniform Resource Locator (URL)


C

A client that wants to access a document needs an address. To facilitate the access of documents
distributed throughout the world, HTTP uses the concept of locators. The uniform resource locator (URL) is a
u

standard for specifying any kind of information on the Internet.


ad

The URL defines four things:


Method
iln

Host computer
m

Port
Path
Ta

The method is the protocol used to retrieve the document, for example HTTP. The host is the computer
where the information is located, although the name can be an alias. Web pages are usually stored in computers,
and computers are given alias names that usually begin with the characters www". This is not mandatory,
however, as the host can be any name given to the computer that hosts the web page.
The URL optionally can contain the port number of the server. If the port is included, it should be
inserted between the host and the path, and it should be separated from the host by a colon.
Path is the pathname of the file where the information is located. Note that the path can itself contain
slashes that, in the UNIX operating system, separate the directories from subdirectories and files.
<br>

Page 120 of 131

32

TCP Connections
The original version of HTTP (1.0) established a separate TCP connection for each data item retrieved
from the server.
It's not too hard to see how this was a very inefficient mechanism: connection setup and teardown
messages had to be exchanged between the client and server even if all the client wanted to do was verify
that it had the most recent copy of a page.
Thus, retrieving a page that included some text and a dozen icons or other small graphics would result in
13 separate TCP connections being established and closed.

g
in
HTTP 10 behavior

er
Client Server

e
SYN

in
SYN +ACK

ng
HTTP Get

Server processes
fE
HTTP Response request

Client parses FIN


O
response
SYN
e

SYN+ACK
g
le

HTTP Get

Server processes
ol

HTTP Response request


C

FIN
u

To overcome this situation, HTTP version 1.1 introduced persistent connections- the client and
ad

server can exchange multiple request/response messages over the same TCP connection.
Persistent connections have many advantages.
iln

First, they obviously eliminate the connection setup overhead, thereby reducing the
load on the server, the load on the network caused by the additional TCP packets,
m

and the delay perceived by the user.


Second, because a client can send multiple request messages down a single TCP
Ta

connection, TCP's congestion window mechanism is able to operate more


efficiently.
This is because it's not necessary to go through the slow start phase for
each page.
<br>

Page 121 of 131

33

Client Server
HTTP Get

Server processes
HTTP Response request

Client parses
response

HTTP Get

Server processes

g
HTTP Response request

in
er
HTTP 1.l behavior with persistent connections

e
Caching

in
One of the most active areas of research (and entrepreneurship) in the Internet today is how to effectively
cache Web pages.

ng
Caching has many benefits. From theclient's perspective, a page that can be retrieved from a ncarby
cache can be displayed much more quickly than if it has to be fetched from across the world.
fE
From the server's perspective, having a cache intercept and satisfy a request reduces the load on the
server.
O
Caching can be implemented in many different places. For example, a user's browser can cache recently
accessed pages, and simply display the cached copy if the user visits the same page again.
e

As another example, a site can support a single site-wide cache.


g

This allows users to take advantage of pages previously downloaded by other users.
le

Closer to the middle of the Internet, ISPs can cache pages.


Note that in the second case, the users within the site most likely know what machine is caching pages on
ol

behalf of the site, and they configure their browsers to connect directly to the caching host. This node is
C

sometimes called a proxy


u

WEB SERVICES
ad

Much of the motivation for enabling direct application-to-application communication comes from the
business world. Historically, interactions between enterprises--businesses or other organizations have
iln

involved some manual steps such as filling out an order form or making a phone call to determine whether some
product is in stock. Even within a single enterprise it is common to have manual steps between software systems
m

that cannot interact directly because they were developed independently.


Increasingly such manual interactions are being replaced with direct application-to application interaction.
Ta

An ordering application at enterprise A would send a message to an order fulfillment application at enterprise B,
which would respond immediately indicating whether the order can be filled. Perhaps, if the order cannot be
filled by B, the application at A would immediately order from another supplier, or solicit bids from a collection
of suppliers.
Amazon and FedEx had to have a protocol for exchanging the information needed to track packagescall it
the Package Tracking Protocol.

Two architectures have been advocated as solutions to this problem.


<br>

Page 122 of 131

34

Both architectures are called Web Services, taking their name from the term for the individual
applications that ofer a remotely-accessible service to client applications to form network applications.
The terms used as informal shorthand to distinguish the two Web Services architectures are SOAP(Simple Object
Access Protocol) and REST(Representational State Transfer ) (as in, "the SOAP vs. REST debate").
The SOAP architecture's approach to the problem is to make it feasible, at least in theory, to generate
protocols that are customized to each network application.
The key elements of the approach are a framework for protocol specification, software toolkits for
automatically generating protocol implementations from the specifications, and modular partial
specifications that can be reused across protocols.
The REST architecture's approach to the problem is to regard individual Web Services as World Wide

g
Web resources-identified by URIs and accessed via HTTP.

in
Essentially, the REST architecture is just the Web architecture.
The Web architecture's strengths include stability and a demonstrated scalability (in the network-size sense).

er
1.Custom Application Protocols (WSDL, SOAP)

e
The architecture informally referred to as SOAP is based on Web Services Description Language

in
(WSDL) and SOAP.4
Both of these standards are issued by the World Wide Web Consortium (W3C).

ng
This is the architecture that people usually mean when they use the term Web Services without any
preceding qualifier.
fE
WSDL and SOAP are frameworks for specifying and implementing application protocols and transport protocols,
respectively. They are generally used together, although that is not strictly required. WSDL is used to specify
application-specific details such as what operations are supported, the formats of the application data to invoke or
O
respond to those
operations, and whether an operation involves a response. SOAP's role is to make it easy to define a transport
e

protocol with exactly the desired semantics regarding protocol features such as reliability and security.
g

Defining Application Protocols


le

WSDL has chosen a procedural operation model of application protocols. An example from W3C's WSDL
ol

Primer is a hotel reservation Web Service with two operations, CheckAvailability andMakeReservation. Each
C

operation specifies a Message Exchange Pattern (MEP) that gives


the sequence in which the messages are to be transmitted, including the fault mnessages to be sent when an error
disrupts the message flow. Several MEPs are predefined, and new custom MEPs can be defined, but it appears
u

that in practice only two MEPs are being used: In-Only (a single
ad

message from client to service) and In-Out (a request from client and a corresponding reply fromservice). These
patterns should be very familiar,and suggest that the costs of supporting MEP flexibility perhaps outweigh the
iln

benefits wSDL nicely separates the parts of a protocol that can be specified abstractly-operations, MEPs,
abstract message formats-from the parts that must be concrete. WSDL's concrete part specifies an underlying
m

protocol, how MEPs are mapped onto it, and what bit-level representation is used for messages on the wire. This
part of a specification is known as a binding, although it is better described as an implementation, WSDL
Ta

modularity should be familiar to anyone who has developed moderately large pieces of software. A WSDL
document need not be a complete specification; it could, for example, define a single message format.
The partial specifications are uniquely identified using XML Namespaces each WSDL document specifies the
URI of a target namespace, and any new definitions in the document are named in the context of that
namespace. One WSDL document can incorporate components
of another by including the second document if both share the same target namespace or importing it if the target
namespaces differ.
Defining Transport Protocols
<br>

Page 123 of 131

35

SOAP provides a simple messaging framework whose core functionality is concerned with providing
extensibility." SOAP uses many of the same strategies as WSDL, including message formats defined using XML
Schema, bindings to underlying protocols, Message Exchange Patterns, and reusable specification elements
identified using XML namespaces.

SOAP 1.2 introduced a feature abstraction, which the specification describes thus: A SOAP feature is an
extension of the SOAP messaging framework. Although SOAP poses no constraints on the potential scope of
such features, example features may include "reliability," "security,"
"correlation, " "routing, " and message exchange patterns (MEPs) such as request/response, one-way, and peer
to-peer coversations. A SOAP feature specification must include:

g
# A URI that identifies the feature

in
#The state information and processing, abstractly described, that is required at each SOAP node to implement
the feature

er
# The information to be relayed to the next node
# If the
feature is a MEP, the life cycle and temporal/causal relationships of the messages exchangedfor

e
example, responses follow requests and are sent to the originator of the request The second and more flexible

in
way to implement features involves header blocks. A SOAP message consists of an Envelope, which contains a
Header that contains header blocks, and a Body, which contains the payload destined for the ultimate receiver.

ng
This message structure is
illustrated in Figure
fE
Envelope
O
Header
Header biock
e

Header biock
g
le

Body
ol
C

SOAP MESSAGE STRUCTURE


Standardizing Web Services Protocols
u

wSDL and SOAP aren't protocols; they are standards for specifying protocols. For different enterprises
ad

to implementWeb Services that interoperate with each other., it is not enough to agree to use WSDL and SOAP
to define their protocols; they must agree on standardize specific protocols. This tension between
iln

standardization and customization is tackled by establishing partial standards called profiles. A profile is a set of
guidelines that narrow or constrain choices available in WSDL, SOAP, and other standards that may be
m

referenced in defining a protocol. They may at the same time resolve ambiguities or gaps in those standards. In
practice, a profile often formalizes an emerging de facto standard. The broadest and most widely adopted profile
Ta

is known as the WS-I Basic Profile. It was proposed by the Web Services Interoperability Organization (WS-I),
an industry consortium, while WSDL and SOAP are specified by the World Wide Web Consortium (W3C). The
WS-I Basic Security Profile adds security constraints to the Basic Profile by specifying how the SSL/TLS layer is
to be used and requiring conformance to WS-Security
2.A Generic Application Protocol (REST)

The WSDL/SOAP Web Services architecture is based on the assumption that the best way to integrate
applications across networks is via protocols that are customized to each application. That architecture is
designed to make it practical to specify and implement all those protocols. In contrast,the REST Web Services
architecture is based on the assumption that the best way to integrate applications across networks is by re
<br>

Page 124 of 131

36

applying the model underlying the World Wide Web architecture. This model, articulated byWeb architect Roy
Fielding, is known as Representational State Transfer (REST). There is no need for a new REST architecture for
Web Services-the existing Web architecture is sufficient, although a few extensions are probably necessary.
The representation of a resource state is abstract; it need not resemble how the resource is actually implemnented
by a particularWeb Service instance. It is not necessary to transmit a complete resource state in each message.
The size of messages can be reduced by transmitting just the parts of a state that are of interest (e.g., just the
parts that are being modified). And, because Web Services share a single protocol and address space with other
web resources, parts of states can be passed by reference-by URIeven when they are otherWeb Services.
This approach is best summarized as a data-oriented or documentpassing style, as opposed to a procedural style.
Defining an application protocol in this architecture consists of defining the document structure (i.e., the state
representation). XML and the lighter-weight JavaScript Object Notation (JSON) are the most frequently used

g
.
presentation languages In contrast with wSDL'SOAP, the Web has had time for standards to stabilize and to

in
demonstrate that it scales very well. It also comes with some security in the form of Secure Socket Layer
(SSL)/Transport Layer Security (TLS). The Web and REST may also have an advantage in

er
evolvability.Although the WSDL and SOAP frameworks are highly flexible with regard to what new features
and bindings can go into the definition of a protocol, that flexibility is irrelevant once the protocol is defined.

e
in
DNS(Domain name System) -Name Service

ng
It is not an application that users invoke explicitly, but an application that all other network applications depend
on. It is used to translate host names into host addresses. We have been using address to identify hosts. While
fE
perfectly suited for processing by routers, addresses are not exactly user friendly. It is for this reason that a
unique name is also typically assigned to each host in a network.
O
Host names differ from host addresses in two important ways.
First, they are usually of variable length and mnemonic, thereby making them easier for
e

humans to remember.
g

Second, names typically contain no information that helps the network locate (route
le

packets toward) the host.


ol

We first introduce some basic terminology.


First, a name space defines the set of possible names.
C

A name space can be either flat (names are not divisble into components), or it
can be hierarchical (Unix file names are an obvious exanple).
u

Second, the naming system maintains a collection of bndings of names to values. The
ad

value can be anything we want the naming system to return when presented with a name;
in many cases it is an address.
iln

Finally, a resolution mechanismn is a procedure that, when invoked with a name, returns the corresponding value.
A name server is a specific implementation of a resolution mechanism that is available on a network and that can
m

be queried by sending it a message.


Ta
<br>

Page 125 of 131

37

User 1
2
cs.princeton.edu [email protected]

Name Mail
server program

192.12.69.5 192.12.69.5 4
3
TCP

g
in
192.12.69.5 5

e er
IP

in
ng
Names translated into addresses, where the numbers 1 to 5 show the sequence of steps in the process.

fE
A naming service can be developed to map user-friendly names into router-friendly addresses. Name
services are sometimes called middleware because they fill a gap between applications and the underlying
O
network.
Host names differ from host addresses in two important ways. First, they are usually of variable length
and mnemonic, thereby making them easier for humans to remember. (In contrast, fixed-length numeric
e

addresses are easier for routers to process).Second, names typically contain no information that helps the
g

network locate (route packets toward) the host. Addresses, in contrast, sometimes have routing information
le

embedded in them; flat addresses (those not divisible into component parts) are the exception.
ol

A namespace defines the set of possible names. A namespace can be either flat (names are not divisible
into components), or it can be hierarchical.
C

The naming system maintains a collection of bindings of names to values. The value can be anything we
want the naming system to return when presented with a name; in many cases it is an address.
u

A resolution mechanism is a procedure that, when invoked with a name, returns the corresponding
ad

value. A name server is a specific implementation of a resolution mechanism that is available on a network and
that can be queried by sending it a message.
iln

What happens in the Internet is that a user presents a host name to an application program, and this
program encages the naming system to translate this name into a host address. The application then opens a
m

connection to this host by presenting some transport protocol with the host's IP address.
Ta

DOMAIN HIERARCHY:
DNS implements a hierarchical name space for Internet objects. Unlike Unix file names, which
are processed from left to right with the naming components separated with slashes, DNS names are processed
from right to left and use periods as the separator.
Like the Unix file hierarchy, the DNS hierarchy can be visualized as a tree, where each node in
the tree corresponds to a domain, and the leaves in the tree correspond to the hosts being named.
DNS names are processed from right to left and use periods as the separator. An example domain name
a
for host is cicada.cs.princeton.edu.
<br>

Page 126 of 131

38

DNS employs a hierarchical namespace rather than a flat namespace, and the "table" of bindings that
implements this namespace is partitioned into disjoint pieces and distributed throughout the Internet. These sub
tables are made available in name servers that can be queried over the network.
There are domains for each country, plus the "big six" domains: .edu, .com, -gov, .mil, .org, and
.net.

edu Com gov mil org net uk fr

princeton
... mit cisco
.. yahoo nasa .. nsf arpa navy acm ... ieee

g
in
CS ee physics

er
ux01 ux04

e
in
Example of a domain hierarchy.

ng
NAME SERVERS:
The first step is to partition the hierarchy into sub trees called zones. Each zone can be thought of as
fE
coresponding to some administrative authority that is responsible for that portion of the hierarchy.
Within this zone, some department is a zone want the responsibility of managing the hierarchy (and so
O
they remain in the university-level zone), while others, like the Department of Computer science, manage their
own department-level zone.
e

The relevance of a zone is that it corresponds to the fundamental unit of implementation in DNS -the
g

name server. Specifically, the information contained in each zone is implemented in two or more name servers.
le

Each name server, in turn, is a program that can be accessed over the Internet. Clients send queries to
name servers, and name servers respond with the requested information. Sometimes the response contains the
ol

final answer that the client wants, and sometimes the response contains a pointer to another that the client should
C

query next.
u

Each name server implements the zone information as a collection of resource records. In essence, a
ad

resource record is a name-to-value binding, or more specifically, a 5-tuple that contains the following fields:
< Name, Value, Type, Class, TTL >
iln

The Name and Value fields are exactly what you would expect, while the Type field specifies
how the Value should be interpreted. For example, Type=A indicates that the Value is in IP address. Thus, A
m

records implement the name-to-address mapping we have been assuming.


Ta
<br>

Page 127 of 131

39

ml ora net uk

prinoeton mit Cisoo yahoo nasast arpa ay acmeee

e AAAAAAAAA
physics

X01UD4

Domain hierarchy partitioned into zones


Other record types include

g
NS: The Value field gives the domain name for a host is running a name server that knows

in
how to resolve names within the specified domain.

er
CNAME: the Value field gives the canonical name for a particular host; it is used to
define aliases.

e
MX: The Value field gives the domain name for a host that is running a mail server that

in
accepts the messages for the specified domain.

ng
The Class field was included to allow entities other than the NIC to define useful record types. To date,
the only widely used Class is the one used by the Internet; it is denoted IN. Finally, the TTL field shows how
fE
long this resource record is valid. It is used by servers that cache resource records from other servers; when the
TTL expires, the server must evict the record from its cache.
O
Root
name server
g e
le
ol

Prin ceton Cisco


name server name server
C
u

CS EE
ad

name server name server


Hierarchy of name servers.
iln

Each zone is implemented by two or more name servers


m

NAME RESOLUTION
It is a procedure to invoke by giving name as input and returns address as output.
Ta

This local name server, in turn, has resource records for one or more of the root servers, for example:
< 'root', a.root-servers.net,NS,IN>
<
a.root-servers.net, 198.41.0.4,A,IN>
Thus, resolving a name actually involves a client querying the local server, which in turn acts as a client that
queries the remote servers on the original client's behalf. This results in the client/server interactions illustrated
in Figure
<br>

Page 128 of 131

40

ROOT
jerald.cs.princeton.edu NAME
SERVER
128,196.12835

4+jerald.cs.princetonedu
princeton,edu, EDU
1: NAME
SERVER
,192.12.69.5
1: jerald.es.princetonedu
LOCAL
CLIENT NAME
6:jerald.cs.princetonedu
SERVER

g
66 8:jerald.
128.112.155.1

in
PRINCETON
cs.princetonedu NAME
9:128.112.

er
-60
158.166

e
in
CS

ng
NAME
SERVER

Name resolution in practice, where the numbers 1 to 10 show the sequence of steps in the process.
fE
SIMPLE NETWORK MANAGEMENT PROTOCOL (SNMP)
O
A network is a complex system, both in terms of the number of nodes that are involved and in terms of the
suite of protocols that can be running on any one node.
e

Even if you restrict yourself to worrying about the nodes within a single administrative domain, such as a
g

campus, there might be dozens of routers and hundredsor even thousands-of hosts to keep track of. If you
le

think about all the state that is maintained and manipulated on any one of those nodesfor example, address
translation tables, routing tables, TCP connection state, and so on then it is easy to become depressed about the
ol

prospect of having to manage all of this information


C

Simple Network Management Protocol (SNMP) is an "nternet-standard protocol for managing


devices on IP networks". Devices that typically support SNMP include routers, switches, servers, workstations,
u

printers, modem racks, and more. It is used mostly in network management systems to monitor network-attached
ad

devices for conditions that warrant administrative attention.


SNMP is essentially a specialized request/reply protocol that supports two kinds of request messages:
iln

GET and SET. The former is used to retrieve a piece of state from some node, and the latter is used to store a
new piece of state in some node.
m

SNMP is used in the obvious way.


A system administrator interacts with a client program that displays information about the network.
Ta

This client program usually has a graphical interface. Whenever the administrator selects a certain
piece of information that he or she wants to see, the client program uses SNMP to request that
information from the node in question. (SNMP runs on top of UDP.)
An SNMP server running on that node receives the request, locates the appropriate piece of
information, and returns it to the client program, which then displays it to the user.
Request syntax is ASN.I BER
<br>

Page 129 of 131

41

EX: The string 1.3.6.1.2.4.3 points to the real-time value IPinReceives, The string 1.3.6.1.2 refers to the specific
hardware being monitored and is provided by the vendor. The 4 refers to the IP group and the 3 refers to the
third value in the group.
GET-NEXT
Functions as a GET but returns the string pointing to the next possible MIB value in addition to the value of the
string in the GET-NEXT.
An SNMP-managed network consists of three key components:
Managed device
Agent- software which runs on managed devices
Network management system (NMS) software which runs on the manager

g
A
managed device is a network node that implements an SNMP interface that allows unidirectional (read-only)

in
or bidirectional access to node-specific information. Managed devices exchange node -specific information with

er
the NMSs.
An agent is a network-management software module that resides on a managed device. An agent has local

e
knowledge of management information and translates that information to or from an SNMP specific form.

in
A network management system (NMS) executes applications that monitor and control managed devices. NMSs
provide the bulk of the processing and memory resources required for network management. One or more NMSs

ng
may exist on any managed network.
Management information base (MIB) fE
SNMP itself does not define which information (which variables) a managed system should offer. Rather,
SNMP uses an extensible design, where the available information is defined by management information bases
O
(MIBs). MIBs describe the structure of the management data of a device subsystem; they use a hierarchical
namespace containing object identifiers (OID). Each OID identifies a variable that can be read or set via SNMP.
e

MIB II organizes variables into 10 different groups which are


g

1.
System parameters,
le

Interface parameters,
iii. Address Translation,
ol

iv. IP
C

V TCP statistics,
vi. UDP statistics,
u

vi. ICMP,
ad

viii. EGP,
ix. SNMP
X. media
iln
m
Ta
<br>

Page 130 of 131

42

Management Management
Information Base SNMP Community Information Base
(MIB) (MIB)

SNMP SET

Network Management Network Element


Station SNMP GET/GET NHEXT (Agent Device)

g
SNMP TRAP (ALERT)

in
e er
in
SNMP Agents

ng
Router
SNMP
Manager SNMP
fE
Server
O

9t Multilayer
e

Switch
g
le
ol
C

How does SNMP work?


A system administrator interacts with a client program that displays information about the network.
This client program usually has a graphical interface.
u

You can think of this interface as playing the same role as a Web browser.
ad

Whenever the administrator selects a certain piece of information that he or she wants to see, the client program
uses SNMP to request that information from the node in question.
An SNMP server running on that node receives the request, locates the appropriate piece of information, and
iln

returns it to the client program, which then displays it to the user.


How does the client indicate which piece of information it wants to retrieve?
m

How does the server know which variable in memory to read to satisfy the request?
o
The answer is that SNMP depends on a companion specification called the management information base
Ta

(MIB).
The MIB defines the specific pieces of informationthe MIB variables that you can retrieve from a
network node.
The current version of MIB, called MIB-II, organizes variables into 10 different groups.
Some examples of the groups are:
1. System: general parameters of the system (node) as a whole, including where the node is located, how
long it has been up, and the system's name.
2. Interfaces: information about all the network interfaces (adaptors) attached to this node, such as the
physical address of each interface, how many packets have been sent and received on each interface.
3. Address translation: information about the Address Resolution Protocol (ARP), and in particular, the
contents of its address translation table.
<br>

Page 131 of 131

43

4. IP: variables related to IP, including its routing table, how many datagrams it has successfully
forwarded, and statistics about datagram reassembly. Includes counts of how many times IP drops a
datagram.
5. TCP: information about TCP connections, such as the number of passive and active opens, the number
of resets, the number of timeouts, default timeout settings, and so on.
6. UDP: information about UDP traffic, including the total number of UDP datagrams that have been
sent and received.
There are also groups for ICMP, EGP, and SNMP itself. The 10th group is used by different media.

g
in
e er
in
ng
fE
O
g e
le
ol
C
u
ad
iln
m
Ta

You might also like