Chapter - Four of Networking
Chapter - Four of Networking
1. Circuit Switching: the data transfer between two nodes must be establish a
path c with each other over a dedicated communication path .
Circuits can be permanent or temporary application in circuit may have
three phases:
1. Establish a circuit
2. Transfer the data
Message Switching
the whole message is treated as a data unit and is switching
Addressing
MAC (Media Access Control) addresses are used in frame headers to
identify source and destination; different from IP addresses!
Error control
error control mechanism to ensure that frames (data bit streams) are
transmitted with certain level of accuracy. But to understand how errors
is controlled, it is essential to know what types of errors may occur.
Data Link Layer Protocol Services in Brief
Error control
Reliable delivery between adjacent nodes
Error control mechanism may involve two ways(Error destcinon and error
corection )
Error detection
Errors can be caused by signal attenuation, noise, etc.
The receiver detects the presence of errors, drops the frame and waits for
retransmission
Error Correction
The receiver dectected error and corrects to rectify bit errors without
resorting to retransmission
Cntd…
Flow Control
Pacing between adjacent sending and receiving nodes
A datagram can traverse various links within a network path, each link
utilizing different protocols.
e.g. Ethernet might be used on the initial link, frame relay across
intermediate links, and 802.11 on the final link.
This diverse protocol implementation allows for seamless data
Where is the link layer implemented?
It exists in each and every host (end systems and routers)
It is implemented in adaptor (network interface card - NIC)
The adaptor
Implements data link and physical layers
Attaches into host’s system bus
e.g., Ethernet card, 802.11 card
Implemented as a combination of hardware and software
Adaptors Communicating
Receiving side
Sending side
Looks for errors, flow
Encapsulates datagram into control, etc.
frame Extracts datagram and
Adds error checking bits, flow passes to upper layer
Data Link Control and Protocols
For reliable data delivery across the link, the data link layer has two
most important responsibilities: flow control and error control,
collectively known as data link control
Error Control
Networks must be able to transfer data from one device to another with
complete accuracy - our wish
Data can be corrupted during transmission - many factors exist - like
transmission impairments
Hence, reliable systems must have a mechanism for detecting and
correcting error
Error control refers to both error detection and error correction
In the data link layer, error control refers primarily to methods of error
detection and retransmission
Anytime an error is detected, specified frames are retransmitted; this
Cntd…
Row parities
column parities
cont’d More overhead
Data and parity bits when transmitted
11001111 10111011 01110010 01010011 01010101
Can detect most errors, If 2 bits in one data unit are damaged and two
bits in exactly the same positions in another data unit are also damaged,
the checker will not detect an error.
cont’d ...
Cyclic Redundancy Check (CRC) : works based on binary division of the
data bits being sent.
The divisor is generated using polynomials.
The sender performs a division operation on the bits being sent and
calculates the remainder.
Before sending the actual bits, sender adds the remainder at the end of the
actual bits.
Actual data bits plus the remainder is called a codeword.
The sender transmits data bits as codewords.
Error Correction
Error correction can be done in two ways:
1. Backward Error Correction: when the receiver detects an error in the data
received, it requests back the sender to retransmit the data unit.
Forward Error Correction: when the receiver detects some error in the
data received, it executes error-correcting code, which helps it to auto-
recover and to correct some kinds of errors. e,g hamming code
Flow control: is used to restrict the amount of data that the
sender can send before receiving an acknowledgement
Congestion control: refers to a mechanism used by the network to limit
congestion.
Flow control and congestion control are not really separable, and
we will refer to both as flow control
Limiting factors: speed of the receiver (to process incoming data),
amount of memory (buffer) to store the incoming data before
Flow control ...
Rate of processing is normally slower than rate of
transmission
The receiver must be able to inform the sender to
temporarily halt transmission until it is ready to receive
more.
If no flow control, when overload occurs
Queues build up
Packets are discarded
Sources retransmit packets
Congestion increases network instability
Flow control prevents network instability by keeping packets
waiting outside the network rather than in queues inside the
Flow and Error Control Mechanisms
1. A Utopian Simplex Protocol
Simplex transmission: from sender to receiver
Processing time is ignored; the receiver is assumed to
process the received data infinitely quickly
Infinite buffer space is assumed to be available on all
nodes
Communication channel is assumed to be free of error
2. Stop-And-Wait ARQ: a protocol in which the sender
should wait until the acknowledgment is received from the
receiver for frame-1.
The sender will wait for the response of the receiver, and then
it will send the next data frame.
Data traffic is simplex, but frames travel in both directions;
hence a half-duplex physical channel suffices.
cont’d ...
3. Sliding Window Protocols
a protocol used as a method of flow control in networks for the transfer of
data.
Multiple frames can be sent at a time by the sender before receiving any
acknowledgment from the receiver.
the receiver can send the acknowledgment of multiple frames transmitted by
the sender using a single ACK frame.
Use full-duplex transmission
Two protocols: Go-Back-N ARQ and Selective Repeat ARQ
Both methods require frames to be numbered.
Sequence numbers
Frames from a sending station are numbered sequentially from 0 to 2m-1,
where m is the number of bits of the sequence number in the frame
cont’d
A. Go-Back-N-ARQ
The sender and receiver have sliding windows
The sender’s window is of fixed size and is at most 2m-1; but other
protocols such as TCP allow variable size windows , it holds frames sent
but not acknowledged.
The receiver’s window is of size 1
The sender sets a timer for each frame sent; the receiver has no timer
The receiver sends positive acknowledgement if a frame has arrived
safe and in order.
If a frame is damaged or out of order, the receiver discards it and keeps
silent and discards all subsequent frames; this causes the timer of the
sender to expire and goes back and resends all frames, beginning from the
one with the expired timer.
The receiver does not need to acknowledge Individually frames
cont’d ...
B. Selective Repeat ARQ
For a noisy link, use Selective Repeat ARQ for resending only the
damaged frame.
the correct frames are received and buffered.
The receiver keeping track of sequence numbers buffers the frames in
memory and sends NACK for only frames which are missing or
damaged.
The sender will send/retransmit a packet for which NACK is received
The sender and receiver windows are both at most half of
(window size is m)
data link layer protocols
1. HDLC (High-Level Data Link Control) is a bit-oriented protocol that used
for communication over the point-to-point and multipoint links that
implemets ARQ(Automatic Repeat Request) mechnism.
support full-duplex communication is possible
2. PPP - Point-to-Point Protocol
Used in the Internet for router-to-router and home user-to-ISP
traffic, e.g., dialup link, ISDN line
One sender, one receiver, one link: easier than broadcast link
No Media Access Control
No need for explicit MAC addressing (use logical link control)
No error correction/recovery, no flow control, out of order
delivery OK
i. MA - Multiple Access
ALOHA is the earliest RA method developed at the
University of Hawaii in the early 1970s.
Originally designed to be used on a radio LAN with a data rate of
9600 bps. Aloha (in Hawaiian language) means hello and
goodbye
Media (Multiple) Access Control....
A base station serves as a central controller; each station sends a frame to
the base station with an uplink frequency of 407 MHz (the solid line in the
figure); the base station sends it to the receiver using a downlink frequency
of 413 MHz (the dashed line in the figure)
Media (Multiple) Access Control....
Potential collisions exist (on the upload link); so wait for
acknowledgement; if none arrives wait a period of time (2 times the
maximum propagation delay), send again if back off (waiting) limit did
not reach; the time it waits increases from one trial to the next
Versions
Pure ALOHA :allows network nodes to transmit data whenever they have
a frame to send, without checking for the status of the channel.
Slotted ALOHA
Time is divided into discrete intervals of one frame duration
The nodes are synchronized so that each node knows when
a slot begins
Transmitting a frame is allowed only at the beginning of a slot
Still collision is possible; collided packets are retransmitted after
a random delay
Media (Multiple) Access Control...
ii. CSMA - Carrier Sense MA - polite version of ALOHA
To minimize the chance of collision, each station first listens to the
medium before sending; “listen before talk”; in the network world
this is called carrier sensing
If the channel is busy, it waits until it is idle
Otherwise it transmits; if a collision occurs, it waits a random
amount of time and starts listening again
The chance of collision is minimized
But may still occur because of the propagation delay (a
station doesn’t know if another one has just started
transmitting) or
If two or more stations start transmitting at the same time
Media (Multiple) Access Control...
iii. CSMA/CD - CSMA with Collision Detection
Adds a procedure to handle a collision
A transmitting station listens to the channel while it is transmitting
(collision detection); if a collision is detected and to reduce the
probability of collision the second time, the sender waits; it has to
back off.
It waits a little the first time, more if a collision occurs again, much
more if it happens a third time, and so on; finally it gives up
In the exponential backoff method, it waits an amount of time
between 0 and (2 power N x maximum_propagation_time),
where N is the number of attempted transmissions
Used in traditional Ethernet
Media (Multiple) Access Control...
iv. CSMA/CA - CSMA with Collision Avoidance
Distributed solution
Nodes are allowed to recognize the loss of a token and create a new
token
Collision occurs when two or more nodes create a new token at the
same time need collision resolution algorithms
Node failures: since each node must relay all incoming data, the failure
of a single node will disrupt the operation of the ring
i. FDMA - Frequency-Division MA
iii. TDMA- Time-Division MA: the stations share the capacity of the
channel in time; time is divided into time frames and each time frame is
further divided into N time slots; each station is allocated a time slot during
which it can send data