Computer Networks Unit 2
Computer Networks Unit 2
Protocols
Control
MAC
Responsible framing
and MAC address and
Multiple Access Control
9
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004
1 Pure ALOHA
• All frames from any station are of fixed length (L bits)
• Stations transmit at equal transmission time (all stations produce frames
with equal frame lengths).
• A station that has data can transmit at any time
• After transmitting a frame, the sender waits for an acknowledgment for an
amount of time (time out) equal to the maximum round-trip propagation
delay
• Time out= 2* tprop
• If no ACK was received, sender assumes that the frame or ACK has been
destroyed and resends that frame after it waits for a random amount of
time
• If station fails to receive an ACK after repeated transmissions, it gives up.
• Channel utilization or efficiency or Throughput is the percentage of the
transmitted frames that arrive successfully (without collisions)
The farthest
station
Station B
receives the
first bit of
the frame at
time t= tprop
Tfr= Frame
Transmission time
Disadvantage
If (M) nodes want to transmit, many collisions can occur and
the rate allocated for each node will not be on average R/M
bps
This causes low channel utilization
Frame Transmission The user can transmit the The user has to wait till
data frame whenever the the next time slot start, to
station has the data to be transmit the data frame.
transmitted.
1. Non-Persistent CSMA
2. 1-Persistent CSMA
3. p-Persistent CSMA
Random Waiting
times
Wasted time
1. If medium idle,
transmit with probability (p), OR
wait one time unit (slot) with probability (1 – p), then repeat 1.
2. If medium busy, continuously listen until idle and repeat step 1
3. Performance
Reduces the possibility of collisions like non-persistent
Reduces channel idle time like 1-persistent
channel wastage .
CSMA/CD is Widely used for bus topology LANs (IEEE 802.3,
Ethernet).
Primary is sending to
Secondary Secondary is sending to
Primary
3. The sender simply sends all its data available onto the
channel as soon as they are available its buffer.
Rule 2: The sender only sends the subsequent packet after getting the
preceding packet’s acknowledgement.
Therefore, the concept behind the stop and wait protocol on the sender’s end
is relatively straightforward:
Send one packet at a time and refrain from sending any additional packets
until you have received an acknowledgement.
As a result, the stop and wait protocol’s basic tenet on the receiver’s end is
similarly extremely straightforward: Ingest the packet, and after it has been
consumed, send the acknowledgement.
This is a mechanism for flow control.
The acknowledgement is then sent by the recipient, but it is not received until
the timeout period has passed on the sender’s end.
Due to the acknowledgement being received after this, it can be mistaken for
acknowledging the receipt of another data packet.
Similarly, sequence numbers are also used in acknowledgments (ACKs) sent by the
receiver to acknowledge received data frames.
When the receiver successfully receives a data frame, it sends an ACK back to the
sender, indicating the sequence number of the next expected frame.
The sender uses this ACK to determine whether the transmission was successful and
whether it can proceed to send the next frame.
WR is always 1 in GBN.
2. Assume that we have lots of sequence numbers just for the sake of
explanation. Now the sender has sent the packets 0, 1, 2 and 3.
4. Now suppose the packet 2 is lost in the network, Receiver will discard all the
packets which sender has transmitted after packet 2 as it is expecting sequence
number of 2.
5. On the sender side for every packet send there is a time out timer which will
expire for packet number 2.
6. Now from the last transmitted packet 5 sender will go back to the packet
number 2 in the current window and transmit all the packets till packet number
5.
7. That’s why it is called Go Back N.
8. Go back means sender has to go back N places from the last transmitted packet
in the unacknowledged window and not from the point where the packet is
lost.
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004
Selective Repeat ARQ
It is also known as Sliding Window Protocol and used for error detection and control
in the data link layer.
In the selective repeat, the sender sends several frames specified by a window size
even without the need to wait for individual acknowledgement from the receiver as
in Go-Back-N ARQ. In selective repeat protocol, the retransmitted frame is received
out of sequence.
In Selective Repeat ARQ only the lost or error frames are retransmitted, whereas
correct frames are received and buffered.
The receiver while 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.
Single-Bit Error
A single-bit error refers to a type of data transmission error that occurs when
one bit (i.e., a single binary digit) of a transmitted data unit is altered during
transmission, resulting in an incorrect or corrupted data unit.
Multiple-Bit Error
Burst Error
CRC Working
We have given dataword of length n and divisor of length k.
Step 1: Append (k-1) zero’s to the original message
Step 2: Perform modulo 2 division
Step 3: Remainder of division = CRC
Step 4: Code word = Data with append k-1 zero’s + CRC
Note:
•CRC must be k-1 bits
•Length of Code word = n+k-1 bits