Sunteți pe pagina 1din 268

Data and Communication

Networks
Communication Networks
• Communication networks enable users to
transfer information
- voice
- video
- e-mail
- computer files
Evolution of Communication Networks
• Telephone networks

• Computer networks

• Cable Television Networks

• Wireless Networks
Telephone Networks
• The key innovations in Telephony
- Circuit Switching
- Digitization
- Common Channel signalling
- Optical links
- Service Integration
Telephone networks around 1890
• Transmissions were analog
• Manually operated switches
Telephone network around 1988
• Transmissions were analog or digital
• Switches were electronic
• Exchange control information is sent by using
CCS
Digital Carrier system

• Trunk capacity divided into a hierarchy of


logical channels

• The basic unit is DS-0 which carries 64kbps and


accommodates one voice channel
Optical Transmission links
• SONET (Synchronous Optical NETwork)
STS (Synchronous Transfer Signal ) hierarchy
Integrated Services Digital Network
(ISDN)
• Basic access provided with two 64kbps and one
16kbps links which can be used to transmit
voice or data
Computer networks
• RS-232-C standard
Transfer of one character at a time
Synchronous transmission
standards
• Many data bits are grouped into packets
• No. of bits in packet may be fixed or variable
Store and forward transmission
• Packet header specifies source and
destination address
• Statistical Multiplexing
Classification of Networks
• Based on transmission technology

• Network topology
Transmission Technology
• Broadcast networks
 Single communication channel shared by all
 Address field specify intended recipient
 Multicasting- Packet delivered to all
machines subscribed to a group
• Point to Point networks
 Connection between individual pairs of
machines
Network Topology
• The way in which a network is laid out
physically
Mesh Topology

• Dedicated point to point link


Star Topology
• Dedicated point to point link only to central
controller
Bus Topology
• One long cable acts as backbone to link all
devices
• Multiple access
Ethernet :
Ring Topology
• Dedicated point to point link between
devices on either side
Categories of Networks

• LAN
• MAN
• WAN

• Network of networks - internetwork or


internet
LAN
MAN
WAN
Protocols
• Set of rules that governs how communicating
parties are to interact
• Examples
HTTP – Hyper Text Transfer Protocol
FTP - File Transfer Protocol
SMTP - Simple Mail Transfer Protocol
IP - Internet Protocol
TCP - Transmission Control Protocol
Uses of Computer Networks
• Resource sharing
Physical resources
Information and documents
• e commerce
• Communication medium
e-mail
interactive working
video conferencing
Network elements
• Principal elements : links and switches
• Link
Transfers from one end to the other with given
BER and fixed propagation time
• Switch
Transfers bits from its incoming links to its
outgoing links
• Buffering
When incoming bit rate exceeds the outgoing
Queueing network model
• Packets get buffered at switch
Packet delay at network
• Total delay
= TRANS + PROP + QD + PROC

• TRANS
Time required to transmit a packet
= Packet size
Transmission speed
• PROP
Signal propagation time
=distance from source to destination
speed of electrical or optical signal
• QD
Queueing delay in the switch
• PROC
Processing time by switches (negligible)
Layered architecture

• Architecture
Specific way of organizing the functions
performed by a computer network when it
provides various services
• Layers
In most networks, functions are organized
into layers
• Services of layer n are implemented by processes
at layer n using the services of layer n-1
Example of layered decomposition of
communication function
• Complex design problem partitioned into a
number of more manageable sub problems
• Decomposition permits standardization –
facilitates network inter connection
• Services provided by different layers and the
interfaces between layers must be specified
Open System Architecture
• Design of computer network equipment that
can communicate with each other

• International Organization for standardization


(ISO) developed a reference model for Open
System Interconnection (OSI)
OSI Reference model

• Overall communication process partitioned


into functions carried out by various layers

• Seven layer model


Peer to peer communication

• In each layer, a process on one machine


carries out a conversation with a “peer
process” on the other machine
Communication between peer processes is
virtual

• SDU - Service Data Unit


• PDU - Protocol Data Unit
• SAP - Service Access Point ( software port)
Encapsulation
• PDU :
SDU with header (control information)
• Layer-n SDU “encapsulated” in layer-n PDU
• Layer-n peer process uses header to deliver the
SDU to the layer n+1 entity
Layer 1 (Physical layer)
• Bottom most layer
• Implements an “unreliable” bit link
- Synchronization errors and noise can
corrupt a packet
• Link : Transmitter, receiver and the medium
• Transmitter inserts preamble at the
beginning for synchronization
• Physical layer standards specify :
Modulation scheme, characteristics of the
interface between Txr, Rx and the medium
Layer 2: Data link layer (point to point
link)

• Supervises the transmission by physical


layer
• Transmitter appends error detection bits
(CRC) and number the packets
• In the case of re-transmission, packet
sequence number is used
• End to end error control preferable to link level
control if BER of link is low
Sub layer 2a: Media Access Control
• Used where computers are attached to a
common link
• Regulate access to the shared link
• MAC append physical address of
destination
• Implements unreliable transmission of
packets
• MAC standards: packet format, MAC addressing
scheme and protocols
Sub layer 2b: Logical Link Control
• Implements error detection or reliable
transmission
• MAC and LLC together constitute the DLL for
multiple access links
Bridge
• Connects two LANs
• Performs selective re-transmission of packets
Layer 3: Network Layer
• Main function is routing
• Routing
Find the path for a packet when computers
are connected by a collection of point to
point links
• Network layer appends unique network
address of source and destination
• Uses “store and forward” transmission along
successive links
• Deals with congestion
• Network layer standards

Packet standards
Addressing scheme
Routing protocols
Router
• Designed to relay packets at a high rate to the
proper link and with a low delay
• Packets are statistically multiplexed
• Demultiplexing is done using network addresses
of the packets.
Layer 4: Transport layer
• Responsible for end to end transfer of
messages
• Connection oriented / connection less
• Segmentation and re assembly
Decomposes messages into packets and
combines packets into messages after
resequencing
Segmentation and re assembly
Blocking and Un blocking
• Packets are numbered
• Time to live, L
- Decrement L as the packet goes
through a network node
- Packets with zero L is discarded
Layer 5: Session layer

• Supervision of connection, dialog control


• Control the manner ( ex. Half duplex)
• Partition large messages by introducing
“synchronization points”
Layer 6: Presentation layer

• Provide the application layer with


independence from differences in data
representation
• Local syntax converted into a “common
transfer syntax”
• Encryption
• Compression
Layer 7: Application layer

• Provide frequently needed communication


services for user applications
Ex: email uses file transfer services
X-25 Protocol
• X-25 is a standard for WAN communications
that defines how connections between user
devices and network devices are established
and maintained.
• It is typically used in the packet-switched
networks (PSNs).
• Recommended In 1976 by the International
Consultative Committee for Telegraphy and
Telephony (CCITT) called the International
Telecommunication Union (ITU) since 1993
X 25 network

• Three general categories of devices:


Data terminal equipment (DTE)
Data communication equipment (DCE)
Packet-switching exchange (PSE)
Data terminal equipment (DTE)
• End systems that communicate across the
X.25 network.
• Usually terminals, personal computers, or
network hosts, and are located on the
premises of individual subscribers.
Data communication Equipment (DCE)
• Communications devices, such as modems
and packet switches that provide the interface
between DTE devices and a PSE
• Generally located in the carrier's facilities
Packet-switching exchange -PSE
• They are switches that compose the bulk of
the carrier's network.
• Transfer data from one DTE device to another
through the X.25 PSN.
Session Establishment
• X.25 sessions are established when one DTE
device contacts another to request a
communication session.
• Receiving DTE accepts or refuse the
connection.
• If the request is accepted, the two systems
begin full-duplex communication.
• Either DTE device can terminate the
connection. After the session is terminated,
any further communication requires the
establishment of a new session
Virtual Circuits
• The X.25 is a packet-switched virtual circuit
network.
• A virtual circuit is a logical connection created
to ensure reliable communication between
two network devices.
• A virtual circuit denotes the existence of a
logical, bidirectional path from one DTE device
to another across an X.25 network.
• Virtual circuits in X.25 are created at the
network layer such that multiple virtual
circuits can be multiplexed onto a single
physical circuit (a physical connection).
• Virtual circuits are demultiplexed at the
remote end, and data is sent to the
appropriate destinations
Separate virtual circuits being multiplexed onto
a single physical circuit.
There are two types of X.25 virtual circuits:
1. Switched virtual circuits (SVCs)
– Temporary connections used for sporadic data
transfers
– Two DTE devices must establish, maintain, and
terminate a session each time the devices need to
communicate
2. Permanent virtual circuits (PVCs)
– Permanently established connections used for
frequent and consistent data transfers.
– Do not require that sessions be established and
terminated.
– DTEs can begin transferring data whenever
necessary because the session is always active
• The basic operation of an X.25 virtual circuit
– Source DTE device specifies the virtual circuit to be
used (in the packet headers)
– Sends the packets to a locally connected DCE device.
– DCE device examines the packet headers to
determine which virtual circuit to use
– Sends the packets to the closest PSE in the path of
that virtual circuit.
– PSEs pass the traffic to the next intermediate node in
the path
• The basic operation of an X.25 virtual circuit-
(continued)
– When the traffic arrives at the remote DCE device,
the packet headers are examined and the
destination address is determined.
– The packets are sent to the destination DTE
device.
– If communication occurs over an SVC and neither
device has additional data to transfer, the virtual
circuit is terminated
X 25 layers

• Physical layer
• Frame layer
• Packet layer:
X.25 Layer mapping with OSI model
Physical layer:
• Deals with the physical interface between an
attached station and the link that attaches
that station to the packet-switching node.
– X.21 is the most commonly used physical layer
standard
Frame layer:
Facilitates reliable transfer of data across
the physical link by transmitting the data as a
sequence of frames.
Uses a subset of HDLC known as Link
Access Protocol Balanced (LAPB), bit oriented
protocol
Packet layer:
• Responsible for end-to-end connection
between two DTEs. Functions performed are:
– Establishing connection
– Transferring data
– Terminating a connection
– Error and flow control
Error control
• Transmission line uses
Error detection
Error correction
• CRC and checksum code (CKS)
Error free transmission
Error Control

• Transmission errors are controlled by two


methods
1. Forward Error Correction (FEC)
* To achieve low error rates. Large
number of redundant bits are required
and efficiency will be low.
* Long code words require complex and
expensive hardware
2. ARQ schemes
* Used when extremely low error rates
are required
* Receiver detects errors, signals back
to transmitter and the word is
transmitted again
* Require a feed back channel
Automatic Repeat Request (ARQ)
1. Alternating Bit Protocol (ABP)
(Also known as stop and wait protocol)
• Simplest retransmission protocol
• Sender numbers packets alternatively 0 & 1
• Receiver acknowledges every packet with same
numbers
• Retransmission by sender if ACK not reached
within time out
Transmission errors may corrupt
packet or the ACK
Need for numbering the packets

• Receiver can identify duplicates


Need for numbering the ACK
• Transmitter can identify the packets for which
acknowledgement is received.
• In the figure, Packet 0 was received two times
• Packet 1 was not received at all
Efficiency of ABP

• Efficiency = fraction of time that the sender


transmits new packets

• ABP is not suitable for long propagation


time
• Efficiency = TRANS
TRANS + 2PROP + ACK
2. Go Back N protocol

• Window size = N

• Sender numbers the packets sequentially,


1,2,3,…N

• Timer with time out period, T


Sequence of transmissions

• Window size 4
• Before transmitting packet with number
‘n+N’, sender waits until it receives ACK of ‘n’.

• If ACK is not received within time out period,


sender retransmits packet ‘n’ and all those
that was transmitted after that.
Retransmission

• Receiver need not store any packet


• Sender has to store up to N packets
Efficiency

• Efficiency = N x TRANS
TRANS + ACK + 2PROP
• Efficiency increases linearly with N upto 100%
• Efficiency = min N TRANS ,1
TRANS + ACK + 2PROP
• Problem:
Given :
Packet size = 1000 bits
ACK = 20 bits
Transmission over 20 km fibre at 100 Mbps
Find :
(a) Efficiency if it is ABP
(b) Value of N for efficiency to be 100% if it is
Go back N.
• Solution:
TRANS = 1000 / R
ACK = 20 / R
PROP = 20 km x 5S / km
( 3.3 to 5 S / km)
= 100 S
Efficiency (ABP) = 4.75 %
Efficiency (Go back N) = 1000N / 21020
For efficiency to be 1, N  21
Selective Repeat Protocol
• Retransmits the only packets that were not
correctly received
• Sender and receiver must be able to store up to N
packets
Flow & Congestion control
Transmission
rate
adjustment

Internal
Transmission
congestion
network

Small Large
capacity capacity
receiver receiver
Flow Control
• Receiver has limited speed and limited
block of memory (buffer)
• Flow control :
* Regulate the flow of data from a sender
to avoid buffer overflow
* Receiver informs the sender about the
amount of data that can be sent
• Methods of flow control

* Stop and wait scheme

* Sliding window protocol


Stop and Wait Scheme
Sliding Window Protocol

• Used by TCP
• Both hosts use a window for each connection
• Window spans a portion of the buffer
• It can slide over the buffer as data and
acknowledgements are sent and received
Sender Buffer

• If sliding window protocol is not used, sender can


send all the bytes in its buffer (upto 211)
Receiver Window

• Next byte to be consumed by the process is 194


• If total size is “N” and “M” already occupied, receiver
window = N - M
Sender Window
Sliding the sender window
Expanding the sender window
Shrinking the sender window
Congestion
• Number of packets sent to the network is
greater than the capacity of the network
• It happens in a system that involves waiting
• Routers and switches have queues
• Buffers hold data before and after
processing input and output queues
Congestion Control

• Open loop
Prevention before it happens

• Closed loop
Removal after it happened
Open loop (Prevention)
• Handled either by the source or the
destination
1. Retransmission policy
Designed to optimize efficiency and at
the same time reduce congestion
2. Window policy
SRP / Go back N
3. Acknowledgement policy
Delayed / no acknowledgement
4. Discarding policy
Less sensitive packets discarded
5. Admission policy
Check the resource requirement of a flow
before admitting to the network
Closed loop (removal)
1. Back pressure
Congested router informs the previous
upstream router to reduce rate of
outgoing packets
2. Choke point
Packet is sent by router to source to
inform it of the congestion
3. Implicit signalling
Source detect delay of ACK and slow down
4. Explicit signalling
Routers set a bit in a packet to inform the
sender or receiver
(a) Backward signalling
(b) Forward signalling
• Delay – Bandwidth product of the connection
=RxT
R = Transmission rate
T = RTT (Round Trip Time)
It represents total bits “in transit”

• Window method is not effective for flow


control if the individual delay – bandwidth
product is large
• Example:
1. For a short wireless link R = 30
kbps & T = 10S
Delay – bandwidth product = 0.3 bits

2. For a fast cross country back bone


R = 2.4 Gbps and T = 30 mS
Delay – bandwidth product = 72 Mb

• Reduced window size does not affect packets in


transit
Congestion Control
• Preventing too much data being injected
into the networks causing switches and
links to become overloaded

• Window mechanisms

• Detects congestion by time outs


• Reduce window size if successive time-
outs occur
( Number of outstanding packets reduced)
• Conflict:
Small window  Reduced congestion
Large window  High efficiency
TCP Congestion Window
Adjustment
• Send packets into network and react to
observable events that occur
• Arrival of an ACK is used as a signal to
send more packets
• Available bandwidth changes over time
• TCP uses many window adjustment
schemes together
1. Additive Increase /
Multiplicative Decrease (AIMD)
• TCP source is not allowed to send faster
than the slowest component
• Maximum window size =
min ( Congestion window, advertised window)
• TCP source sets the congestion window
based on the level of congestion it
perceives to exist
• TCP interprets time outs as a sign of
congestion and reduces the rate of
transmission
(Assumes that packet dropping due to error
is rare)
• Additive increase:
If ACK is received within time out, it adds 1
packet to its congestion window
ie. Linear increase
• Additive Increase
Source Destination
• Multiplicative Decrease:
Each time a time out occurs, source sets
congestion window to half of its previous
value
• Stable congestion control mechanism:
Source is willing to reduce window size at
a much faster rate than it increases it
• Congestion window – saw tooth pattern
• Typical TCP sawtooth pattern

70
60
50
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)
2. Slow start
• AIMD is used when source is operating
close to the available capacity of the
network

• Slow start is used to increase the


congestion window rapidly from a cold start
• Routers may not be able to consume a
burst of packets

• Instead of sending packets of 1


advertised window, it starts by setting
window size to 1 and increases
exponentially
Source Destination
3. Fast Retransmit and Fast
Recovery
• Retransmission of a dropped packet is
sooner than the regular time out mechanism
• When a packet arrives out of order, TCP
sends the same ACK (duplicate) it has sent
last time
Sender Receiver
Packet 1
Packet 2
Packet 3 ACK 1

Packet 4 ACK 2

Packet 5 ACK 2

Packet 6
ACK 2
ACK 2

Retransmit
packet 3

ACK 6
• Sender waits until it receives some
duplicate ACKs (earlier packet may not be
lost, but delayed) and retransmits the
missing packet

• Fast recovery:
When congestion is detected, congestion
window is reduced to half (not reduced to 1)
TCP Congestion Control
• Slow start:
 When connection established, sender
initializes CW to MSS (Max. Segment Size,
default value 536 bytes)
 If this segment acknowledged, CW
doubled
 CW increases exponentially until time out
occurs or receiver‟s window reached
• Threshold:
 Half the value of CW (max).
 When a time out occurs, it is set to half of
the current CW, and CW is reset to 1 MSS
 Slow start initialized
 Exponential growth stops when threshold
is hit, then CW increased linearly
Illustration:
• MSS initially at 1024 bytes
• CW initially at 64 kB
• Threshold set to 32 kB (CW/2)
• CW grows exponentially until it hits
threshold
• Increases linearly after threshold
• Time out occurs at txn 13
• Threshold set to 20 kB (CW/2)
• Slow start initiated again
Congestion Avoidance
• Congestion Control
TCP needs to create losses to find
available bandwidth
• Congestion Avoidance
Predict when congestion is about to occur
and reduce data rate to avoid packet loss
DEC bit
• Responsibility for congestion control is split
between routers and end nodes
• Routers monitor the load, “explicitly”
notifies end nodes when congestion is
about to occur
• Routers set a binary congestion bit in the
packets
• Destination host copies this congestion bit
into ACK
• Source adjusts its sending rate
• Bit is set if its average queue length is
greater than or equal to 1
• Averaging interval =
last busy cycle + idle time + current busy cycle

• Source records fraction of last window‟s


worth of packets resulted in setting the bit

• If it is less than 50%, increases congestion


window by 1, otherwise reduces by 1/8
(Additive Increase Multiplicative Decrease)
Queue
Length

Current time

Previous Current Time


cycle Cycle

Averaging interval
Random Early Detection
• Routers monitor their queue length
• When congestion is about to occur, notify
source to adjust its congestion window
• Implicit signaling – drops one of the packets
• Source notified by subsequent time out or
duplicate ACK
• “Early” – drops packets earlier than it would
have to.

• RED drops a packet with some drop


probability when ever queue length exceeds
some drop level
Source based congestion
avoidance
• As queues build up in the routers, there is a
measurable increase in the RTT for each
successive packet
Algorithm 1
• CW normally increases

• At every two RTT, checks if current RTT is


greater than the average of min and max
RTTs seen so far

• If so decreases CW by 1/8
Algorithm2
• Decision based on changes in both RTT
and window size
• Window adjusted once every two RTT
based on

(Current window – old window) x


(Current RTT – old RTT)
• If “positive”:
Decreases window size by 1/8

• If „0’ :
Increases window by one packet size

• Window oscillates around its optimal opint


Data Link Controls
• Functions required to enable the transfer of
frames at the data link layer
– Framing
– Error control
– Flow control
– Address information
Data Link Protocols
• A data link protocol is a set of specifications
used to implement the data link layer
Asynchronous Protocols
• In asynchronous transmission a data unit is
transmitted with no timing coordination
between sender and receiver
• Employed mainly in modems
• Asynchronous Transmission is often referred
to as start-stop transmission because the
transmitting device can transmit a character
whenever it is convenient.
• Each character is transmitted independent of
all other characters.
• A start bit ‘0’, and a stop bit ‘1’ are added to
each character.
• The recognition of the start and stop of each
message is called synchronization.
Asynchronous Transmission

5-157
Asynchronous Protocols
• XMODEM
– Used for file transfer over telephone line
– Half-duplex, stop and wait protocol
Field 1 – One byte SOH, start of header
Field 2 – Two byte header, sequence no. (frame no.) &
validity check for seq. no.
Field 3 – 128 bytes of data
Field 4 – CRC for data only
Asynchronous Protocols - contd
YMODEM
• It is a protocol similar to XMODEM with the
following exceptions:
1. The information field has a maximum capacity of
1024 bytes.
2. ITU-T-CRC 16 is used to calculate the frame check
sequence.
3. Multiple frames can be sent in succession and
then acknowledged with a single ACK or NAK
character.
ZMODEM
• Combining features of XMODEM & YMODEM
Synchronous Protocols
• Character-oriented (byte-oriented) protocols – the
frame or packet is interpreted as a series of
characters
• Bit-oriented protocols – the frame or packet is
interpreted as a series of bits
Character-oriented Protocol
Binary Synchronous Communications (BSC)
– Developed by IBM in 1964
– Usable in point-to-point and multipoint, supports half
duplex, stop-and –wait ARQ flow control and error
correction
• BSC Control characters (represented by one or more
char)
– ACK 0 – good even frame received or ready to receive
– ACK 1 – good odd frame received
– ENQ – request for a response
– NAK – bad frame received
– SYN – alert receiver to incoming frame
BSC (contd.)

• BSC Frames
– Data Frames
• SYN character alert the receiver to the arrival of a new
frame and provide a bit pattern for time synchronization
• STX (start text), ETX (end text), BCC (block check count)
– Data Frames with header field
• SOH (start of header)
• Header include address of receiving device, address of
sending device, frame number for stop-and-wait ARQ
– Multiblock Data Frames
• message may be divided into several blocks
• ITB (intermediate text block)
• error checking done for each block, if any block
contains error, the entire must be retransmitted
• only single acknowledgment required
Multiframe Data Transmission
• some messages may be too long to fit into one
frame – split message
• ETB (end transmission block) is used instead of
ETX to signify that the end of frame is not the
end of transmission
• receiver must acknowledge each frame
Control Frames
• carries information specific to the functioning
of the data link layer itself – establishing
connections, flow and error control,
terminating connections
Synchronous Protocols -contd
• Bit-oriented Protocols
Synchronous Protocols
• Bit-oriented Protocol
– Synchronous Data Link Control (SDLC)
• Developed by IBM in 1975
– High-level Data Link Control (HDLC)
• ISO and ITU-T standard
• All bit-oriented protocols are related to HDLC
• Support half-duplex, full-duplex modes and
point-to-point, multipoint configurations
High-level Data Link Control (HDLC)
– Station Types
• Primary – Complete control of the link; sends
commands to secondary stations
• Secondary – Sends responses on command
received
• Combined – Behave either as primary or
secondary; send commands and responses
HDLC contd..
Configuration – Unbalanced (master/slave)
• One device is primary and others are
secondary
• Point-to-point and multipoint
• Configuration – Symmetrical
• Each physical station consists of two logical
stations – a primary and a secondary
• Separate links for two logical stations
• Control of link can shift between the two
stations
• Configuration – Balanced
• Both stations in point-to-point topology
are of the combined type
• A single link is used and can be controlled
by either stations
Modes of Communication
• Normal response mode (NRM)
–Standard primary-secondary relationship
–A secondary device must have permission from
the primary before transmitting
• Asynchronous response mode (ARM)
–A secondary may initiate a transmission without
permission from the primary whenever the
channel is idle
–All transmission from a secondary (even to
another secondary) must be through the primary
• Asynchronous balanced mode (ABM)
–In balanced configuration; all stations are
equal; any one can initiate transmission
without permission from the other
Frames
• I-frames (Information frames)
– Used to transport user data and control
information relating to user data
• S-Frames (Supervisory frames)
– Used only to transport control information,
e.g. flow control, error control
U-Frames (unnumbered frames)
Used for the initiation and termination of a link
and for sending various kinds of supplementary
control information
– Reserved for system management,
i.e. managing the link itself
HDLC contd..
I-frame (Information frame)
• Flag – a byte with bit pattern 01111110 that
identifies the beginning and end of frame and for
synchronization.
• Address – one byte or multiple byte; “Source
address” (if secondary) or “Destination address”
(if primary)
• Control – for acknowledgment of the number of
frame received and the number of frame expected
• FCS – error detection; two or four bytes CRC
HDLC contd..

S-frame (Supervisory frame)


• Flag, address, FCS – similar to I frame
• Four types of S-frames, depending upon the
content in Control field.
• Types of S-frames:
– Receive Ready (RR)

– Reject (REJ)

– Receive Not Ready (RNR)

– Selective Reject (SREJ)


U-frame (Un-numbered frame)
• Flag, address, FCS – similar to I frame
• Control – identifies type of U-frame
• Information – used for managing the
network; may or may not be present.
• Examples for U-frames
– SABM: Set Asynchronous Balanced Mode
– SNRM: Set Normal Response Mode
– DISC: Disconnect frame, station wishes to
terminate.
Synchronous Protocols
• Link Access Procedures (LAP)
– LAPB – LAP Balanced
• a simplified subset of HDLC; uses ABM; used in ISDN on
B channel
– LAPD – LAP for D channel
• uses ABM; used in ISDN on D channel
– LAPM – LAP for Modem
• a simplified subset of HDLC for modems; designed to
do asynchronous-synchronous conversion, error
detection and retransmission
Routing
Switched network

• It is geographically distributed and consists of


a collection of transmission lines (links)
interconnected by switches (nodes).
• Two fundamental approaches for data transfer
over packet switched network
1. Connection oriented
-Allocation of resources
2. Connectionless (datagram)
Datagram packet switching
Different approaches for packet
switching
1. Datagram approach

2. Virtual circuit approach


Virtual Circuit Switching
• Technique used in a switched WAN
• Two WAN technologies that use virtual circuit
switching
– Frame Relay
– ATM
• Establishment of a fixed path between a
source and a destination prior to the transfer
of packets.
• As in the datagram approach, transmission
links are shared by packets from many flows.
• Advantages
– 1. Number of bits required in the header is
reduced to the number required to represent the
maximum number of simultaneous connections
over an input port.
– 2. Use of abbreviated headers allow fast
processing and forwarding of packets.
– 3. Resources allocated during connection setup.
• Disadvantages
– 1. The amount of state information grows very
quickly with the number of flows.
– 2. When failures occur, all affected connections
must be set up again.
Routing in packet networks
• A packet switched network consists of nodes
interconnected by communication links in an
arbitrary mesh-like fashion.
• A packet could take several possible paths
from host A to host B.
Which is the “best” path?
• If the objective function is to minimize the
number of hops, path 1-3-6 is the best.
• If the objective function is to minimize the end
to end delay, the best path is the one which
gives minimum end to end delay.
• Selecting the path with the greatest available
bandwidth.
• The purpose of the routing algorithm is to
identify the set of paths that are the best in a
sense defined by the network operator.
• A routing algorithm must have global
knowledge about the network state in order
to perform its task.
• A routing algorithm must seek one or more of the
following goals.
1. Rapid and accurate delivery of packets
2. Adaptability to changes in network topology
resulting from node or link failures.
3. Adaptability to varying source-destination traffic
loads.
4. Ability to route packets away from temporarily
congested links
5. Ability to determine the connectivity of the network.
6. Low overhead.
Routing algorithm classification
• Static routing
Pre-computed paths are manually loaded to
the routing table and remain fixed for a long
period of time.

• Suitable for small networks


• Inability to react rapidly to network failures.
• Dynamic (adaptive) routing
Each router continuously learns the state of
the network by communicating with
neighbors.
• Each router can compute the best paths to the
desired destinations.
• Disadvantage: Added complexity in the router.
• Centralized routing
Network control centre computes all routing
paths and then uploads this information to the
routers in the network.
• Distributed routing
Routers cooperate by means of message
exchanges and perform their own routing
computations
• If the routes calculated by different routers are
inconsistent, loops can develop.
• Routing decision can be made on a per packet
basis or during the connection setup time.
• Virtual Circuit packet switching, path (virtual
circuit) is determined during the connection
setup phase.
• Once the virtual circuit is established, all packets
belonging to the virtual circuit follow the same
route.
• Datagram packet switching does not require a
connection setup. The route followed by each
packet is determined independently.
Routing Tables
• Once the routing decision is made, the
information has to be stored in a routing
table.
• Virtual Circuit packet switching
Routing table translates each incoming virtual
circuit number to an outgoing virtual circuit
number and identifies the output port to
which to forward the packet.
• Datagram networks
Routing table identifies the next hop to which
to forward the packet based on the
destination address of the packet.
Virtual Circuit packet switching

• There are two virtual circuits between host A


and switch 1.
• A packet from host A with VCI 1 in the header
will reach host B.
• A packet from host A with VCI 5 in the header
will reach host D
• For each source-destination pair, the VCI has
local significance only.
• Advantages of having local VCI
1. More virtual circuits can be assigned.
2. Searching for an available VCI is simple.
Virtual Circuit packet switching
Virtual Circuit Network

Routing table
Routing table for datagram network

No virtual circuit
has to be set up
since no
connection exists
between a source
and a destination
Shortest Path Algorithms
• Network routing is a major function at the
network layer and is concerned with the
problem of determining feasible paths from
each source to each destination.
• A router or a packet switched node performs
two main functions:
1. Routing
Algorithm finds an optimal path to each
destination and stores the result in the routing
table
2. Forwarding
A router forwards each packet from an input port
to the appropriate output port based on the
information stored in the routing table.
A sample network with link costs
• Many metrics can be used to assign a cost to
each link depending on which function is to be
optimized.
1. Cost ~ 1/ capacity
Objective is to send the packet through a path
with the highest capacity
1. Cost ~ packet delay
Packet delay includes queueing delay and
propagation delay
1. Cost ~ congestion
Shortest path tries to avoid congested links.
Bellman-Ford Algorithm
d13

d56

• The average delay in each link is


estimated by the corresponding transmitter
• Example for estimation:
 Transmitter on each link keep track of the
“backlog in its buffer” to calculate the
average delay
( no. of bits in buffer / transmission rate)
 The propagation time can be added to
improve the estimate
• Delay dij on the link from i to j estimated for all
pairs of nodes
• Let xi be the minimum delay between node i
and some fixed destination

xi  min{dij  x j }
j

• This can be solved by recursion which will


converge to the vector of minimum delays for
any non negative initial vector
• Once minimum delays have been calculated,
the fastest path to the destination is identified
and the packet should be sent to the node
which has the minimum delay
Example

• Find the shortest path from node 2 to


node 6
• From 2, it may go through 1,4 or 5
• Suppose some one tells about shortest path from
1, 4 and 5 to the destination (node 6) : 3, 3, and 2
respectively
• If packet goes to 1, total distance = 3 + 3 = 6
• If it goes to 4, distance = 1 + 3 = 4
• If it goes to 5, distance = 4 + 2 = 6
• Shortest path achieved if it goes to node 4
• Distance from a node to itself is 0

dii = 0

• Link cost between node i and node k is infinite


if node i and k are not directly connected

d15 = d23 = 
• Min cost from node 2 to destination (node 6)
can be calculated by
x2 = min d21 + x1, d24 + x4, d25 + x5) 
= min  3 + 3, 1 + 3, 4 + 2 
= 4
• Thus the minimum cost from node 2 to node 6 is
equal to 4 and the next node to visit is node 4

• We have assumed that the minimum costs from


nodes 1, 4 and 5 to the destination node were
known

• In general these nodes would not know this


without performing similar calculations
• x1 = min d12 + x2, d13 + d3, d14 + x4) 
• x4 = min d41 + x1, d42 + d2, d45 + x5) 
• These equations are circular
x2 depends on x1 and
x1 depends on x2
• If we keep iterating and updating these
equations, the algorithm will converge
• Assume initially that
x1 = x 2 = x 3 = x 4 = x 5 = 
and x6 = 0 ( node 6 is the destination and
distance of one node to itself is 0)
• We can summarize the Bellman-Ford Algorithm
as follows:
1. Initialization:
xi =  id
xd = 0
2. Updating: For each i  d
xi  min{di j  x j } ji
j

Repeat step 2 until no more changes occur


• Apply Bellman-Ford algorithm to find minimum
cost from each node to node 6 and the next
node along the shortest path
• Each node i is labeled by (n, xi)
n is the next node along the current
shortest path and
xi is the current minimum cost from node
i to the destination
• If the next node is not defined, set n to -1
• The algorithm terminates at third iteration
• Shortest path tree
Overview of internet protocols
Internet protocol layers

Application

Transport

Internet

Network
Interface
• Internet layer
Designed to glue together different networks
(Ethernet, FDDI,..)
• End to end delivery requires 2 tasks
1. Addressing
2. Routing
Address- 48 bit unique MAC address (H/W
address or physical address) and
Unique IP address
• Transport layer performs:
1. Multiplexing
2. Error control and re-ordering
3. Flow control and congestion control
• UDP:
User Datagram Protocol

Only adds multiplexing to the packet


delivery and discards corrupted packets
• TCP
Transmission Control Protocol
Adds all the tasks and implements error free and
ordered delivery of packets
TCP/IP Addressing information
Internet layers
Internet Protocol (IP)
• It is the host-to-host network layer delivery
protocol for the internet.
• IP is an unreliable and connectionless
datagram protocol.
• A best effort delivery service- means that IP
provides no error control or flow control.
• It uses an error detection mechanism and
discards the packet if it is corrupted.
• If reliability is important, IP must be paired
with a reliable protocol such as TCP.
• Packets in the IP layer are called datagrams.
Internet Protocol version 4 (IPv4)
• IPv4 was the first version of Internet Protocol
to be widely used, and accounts for most of
today’s Internet traffic. There are just over 4
billion IPv4 addresses which is not enough to
last forever.
IPv4 header format
• Version
Defines the version of the IP
Version no. (4/5/6)
version 5 – real time stream protocol

• IHL ( Internet Header Length)


Because of the option field, the length of
header is variable.
Specifies length of header in 32 bit words
If no options, IHL = 5
• Type of service
Defines the class of the datagram for QoS purposes
3 bits for priority
4 bits for requirements ( Delay, throughput,
reliability, and cost requirements)
• Total length
Total length (header + data) in no. of bytes of IP
packet ( Max size- 64kB)
• Identification, flags & fragment offset
Used for fragmentation and re assembly
– Identification
All the fragments will have the same
identification number which helps in reassembly.
– Flags (3 bit field)
• Second bit indicates whether it can be further
fragmented or not.
• Third bit indicates whether it is the last fragment of a
datagram or more fragments follow.
– Fragment offset (13 bit field)
• Shows the relative position of the fragment.
• Time to Live (TTL)
-No. of hops that the packet is allowed to
traverse.
-The value stored by source host will be
approximately 2 times the maximum number
of routers between any two hosts.
-Each router that processes the datagram
decrements this number by 1 and if it
becomes zero, discards the datagram.
• Protocol (Defines the higher level protocol that
uses the services of the IP layer)
Helps in demultiplexing at the destination.
TCP – 6
UDP - 17
• Header checksum
Header of the IP packet changes at each router.
Data part not verified.
If verification fails, packet discarded.
• Source and Destination IP address
• Options
Used for network testing and debugging.
Also allows packets to request special
features such as security level, route to be
taken, time stamp at each router
• Padding
Used to make header a multiple of 32 bit
words
IP addressing –
Class-ful scheme
• Host ID
Provided by network administrator
• Net ID
Provided by internet network information
centre
IP Address- Dotted decimal
representation
• Address broken into four bytes, each byte
represented by decimal number
Example:
10000000 10000111 01000100 00000101 :
128.135.68.5
Drawbacks of original addressing scheme
• In Class B host ID of 16 bits, 64000 nodes,
difficult to manage
• Typical campus requires more than one
LAN , ie. multiple network address
Subnet Addressing

 Added another hierarchical level, “subnet”


 Host outside the organization still see the original
address structure
 Free to choose any combination of lengths for subnet &
host ID fields
• Example:
• Organization has network ID is 150.100
• It has many LANs each with approx. 100
hosts
• 7 bits sufficient to identify a host
• Other 9 bits used to identify subnets
• To find the subnet number router uses a
subnet mask
Subnet mask is 255.255.255.128
ie 11111111. 11111111. 11111111. 10000000.
IPv6
• Heavy demands for new IP addresses
32 bits exhausted soon
• IPv6 support new applications like real-time
audio and video transmission which
requires minimum delay strategies and
reservation of resources which are not
provided in IPv4.
Differences between IPv4 and IPv6

• Longer address field (128 bits)


• Simplified header format
• Flow label capability
• Support larger packets ( > 64 kB)
• No checksum field
Reduced processing time in routers
Header format
• Version
Version no, 6 for IPv6
• Traffic class
Class or priority of packet with respect to traffic
congestion.
• Flow label
Sequence of packets which require special handling at
routers (support real time audio or video)
• Payload length (specified by 16 bits)
65536 bytes ( Larger payloads can be sent with
extension headers
• Next Header
Type of extension header that follows the basic
header
• Hop limit
Replaces TTL in IPv4
• Dotted decimal representation will be long for
IPv6
Hexadecimal digits used
• Ex:
4BF5. AA12. 0216. FEBC. BA5F. 039A. BE9A.
2176

128 bits divided into groups of 16 bits


Transport layer protocols
• The transport layer is responsible for process
to process delivery of packet.
• At the transport layer we need a transport-
layer address, called port number to choose
among multiple processes running on the
destination host.
Transmission Control Protocol
(TCP)
• Reliable, connection oriented stream
service over IP
• Implements a version of SR ARQ
• Establishes a full duplex connection
between two processes by setting up
variables used like MSS (Maximum
Segment Size)
• Implements congestion & flow control
• Each direction of connection is terminated
separately
• Does not preserve message boundaries
• Splits or combines the application
information to match the underlying
network
TCP header
• Sequence number
– TCP is a stream transport protocol and each
byte must be numbered.
– Sequence number of first byte of information
in a segment (Every byte has a number)
 Sequence number, ACK and advertised
window involved in TCP‟s sliding window
algorithm
• Offset
Gives number of 32 bit words in the TCP
header to indicate the starting of data.
The length of header can be between 20 and
60 bytes.
• ACK (32 bit)
ACK(n) means that the next expected byte is
„n‟, if ACK(n) is received 3 times, sender
assumes that the byte is lost
• Flags (6 bits)
Used to exchange control information
Flags:
SYN, FIN, RST, PSH, URG, ACK
• SYN
Set to establish a connection
• FIN
Set to request normal termination
• RST
Set while connection is terminated
• PSH
Set to indicate that send buffer was
emptied
• URG
If set, urgent pointer (16 bit) indicates
position of first non-urgent data
• ACK
Set once connection is established
(Indicates validity of ack no)
• Checksum over header and data

S-ar putea să vă placă și