CN Week 10

Download as pdf or txt
Download as pdf or txt
You are on page 1of 63

Dr.

Sushruta Mishra (CN lecture notes)


Access Control in
Networking
Point to Point Link-
Broadcast Link-
v Point to Point link is a dedicated link that exists
v Broadcast link is a common link to which multiple
between the two stations.
stations are connected.
v The entire capacity of the link is used for transmission
v The capacity of the link is shared among the
between the two connected stations only.
connected stations for transmission.
v Depending upon the Type Of Channel, the data flow
takes place between the stations.
Ø Access Control is a mechanism that controls the access of stations to the transmission link.
Ø Broadcast links require the access control.
Ø This is because the link is shared among several stations.

Consider a situation where-

Multiple stations place their data packets on the link and starts transmitting simultaneously.
Such a situation gives rise to a collision among the data packets.
Collision of data packets causes the data to get corrupt.
To prevent the occurrence of collision or if the collision occurs, to deal with it.

Here,
ü Two stations A and D starts transmitting their
data packets simultaneously.
ü This situation gives rise to a collision between
the data packets transmitted by them.
ü Thus, to prevent the collision or to deal with it,
access control is needed.
Ø Access control methods are the methods used for providing access control.
Ø They prevent the collision or deal with it and ensures smooth flow of traffic on the network.
Ø They are implemented at the data link layer of the OSI reference model.
In Random Access Protocol, all stations have same superiority
that is no station has more priority than another station.

In Controlled Access Protocol, the data is sent by that station


which is approved by all other stations.

In Channelization Protocol, the available bandwidth of the link is


shared in time, frequency and code to multiple stations to access
channel simultaneously.
Aloha
Pure Aloha-

q It allows the stations to transmit data at any time whenever they want.
q After transmitting the data packet, station waits for some time.

Then, following 2 cases are possible-

Case-01:
Transmitting station receives an acknowledgement from the receiving station.
In this case, transmitting station assumes that the transmission is successful.

Case-02:
Transmitting station does not receive any acknowledgement within specified time from the receiving station.
In this case, transmitting station assumes that the transmission is unsuccessful.
Then,

Transmitting station uses a Back Off Strategy and waits for some
random amount of time. After back off time, it transmits the data
packet again. It keeps trying until the back off limit is reached after
which it aborts the transmission.
The maximum efficiency of
Pure Aloha is very less due to
large number of collisions.
Slotted Aloha-

q Slotted Aloha divides the time of shared channel into discrete intervals called as time slots.
q Any station can transmit its data in any time slot.
q The only condition is that station must start its transmission from the beginning of the time slot.
q If the beginning of the slot is missed, then station has to wait until the beginning of the next time slot.
q A collision may occur if two or more stations try to transmit data at the beginning of the same time slot.
A group of N stations share 100 Kbps slotted ALOHA channel. Each station output a 500 bits frame on an average of
5000 ms even if previous one has not been sent. What is the required value of N?
CSMA / CD
CSMA / CD stands for Carrier Sense Multiple Access / Collision Detection

This access control method works as follows-


v Step-01: Sensing the Carrier
v Step-02: Detecting the Collision
v Step-03: Releasing Jam Signal
v Step-04: Waiting For Back Off Time
Step-01: Sensing the Carrier

v Any station willing to transmit the data senses the carrier.


v If it finds the carrier free, it starts transmitting its data packet otherwise not.
v Each station can sense the carrier only at its point of contact with the carrier.
v It is not possible for any station to sense the entire carrier.
v Thus, there is a huge possibility that a station might sense the carrier free even when it is actually not.

If station A senses the carrier at its point of contact,


then it will find the carrier free. But the carrier is
actually not free because station D is already
transmitting its data. If station A starts
transmitting its data now, then it might lead to a
collision with the data transmitted by station D.
Step-02: Detecting the Collision

In CSMA / CD,

v It is the responsibility of the transmitting station to detect the collision.


v For detecting the collision, CSMA / CD implements the following condition.
v This condition is followed by each station-

According to this condition,

Each station must transmit the data packet of size whose transmission delay is at least twice its propagation delay.
If the size of data packet is smaller, then collision detection would not be possible.
Step-03: Releasing Jam Signal

v Jam signal is a 48 bit signal.


v It is released by the transmitting stations as soon as they detect a collision.
v It alerts the other stations not to transmit their data immediately after the collision.
v Otherwise, there is a possibility of collision again with the same data packet.
v Ethernet sends the jam signal at a frequency other than the frequency of data signals.
v This ensures that jam signal does not collide with the data signals undergone collision.
Step-04: Waiting For Back Off Time

v After the collision, the transmitting station waits for some random amount of time called as back off time.
v After back off time, it tries transmitting the data packet again.
v If again the collision occurs, then station again waits for some random back off time and then tries again.
v The station keeps trying until the back off time reaches its limit.
v After the limit is reached, station aborts the transmission.
v Back off time is calculated using Back Off Algorithm.
Important Notes

Note-01:
CSMA / CD is used in wired LANs.
CSMA / CD is standardized in IEEE 802.3

Note-02:
CSMA / CD only minimizes the recovery time.
It does not take any steps to prevent the collision until it has taken place.

Important Formulas-
Condition to detect collision: Transmission delay >= 2 x Propagation delay
Minimum length of data packets in CSMA / CD = 2 x Bandwidth x Distance / Speed
Efficiency of CSMA / CD = 1 / (1 + 6.44 x a) where a = Tp / Tt
We have discussed-

• CSMA / CD allows a station to transmit data if it senses the carrier free.


• After undergoing collision, station waits for random back off time before transmitting again.
• Back Off Algorithm is used to calculate back off time.
In a CSMA / CD network running at 1 Gbps over 1 km cable with no repeaters, the signal speed in the cable is 200000
km/sec. What is minimum frame size?

A 2 km long broadcast LAN has 107 bps bandwidth and uses CSMA / CD. The signal travels along the wire at 2 x 108
m/sec. What is the minimum packet size that can be used on this network?

50 B
100 B
200 B
None of the above
Polling
In this access control method,
Ø A polling is conducted in which all the stations willing to send data participates.
Ø The polling algorithm chooses one of the stations to send the data.
Ø The chosen station sends the data to the destination.
Ø After the chosen station has sent the data, the cycle repeats.
Time Division
Multiplexing
In Time Division Multiplexing (TDM),

v Time of the link is divided into fixed size intervals called as time slots or time slices.
v Time slots are allocated to the stations in Round Robin manner.
v Each station transmit its data during the time slot allocated to it.
v In case, station does not have any data to send, its time slot goes waste.
v The size of each time slot is kept such that each station gets sufficient time for the following tasks-
To put its data packet on to the transmission link
Last bit of the packet is able to get out of the transmission link
If transmission delay and propagation delay of a packet in Time Division Multiplexing is 1 msec each at 4 Mbps
bandwidth, then-
ü Find the efficiency.
ü Find the effective bandwidth.
ü How many maximum stations can be connected to the network if each station requires 2 Kbps bandwidth?
Ethernet
q A Local Area Network (LAN) is a network of computers.
q It is confined to a small area which may be a room, building or a group of buildings.
q A LAN may be wired, wireless or a combination of the two.

• Ethernet is one of the standard LAN technologies used for building wired LANs.
• It is defined under IEEE 802.3.
Characteristics-
v Ethernet uses bus topology.
v In bus topology, all the stations are connected to a single half duplex link.

v Ethernet uses CSMA / CD as access control method to deal with the collisions.

v Ethernet uses Manchester Encoding Technique for converting data bits into signals.

v For Normal Ethernet, operational bandwidth is 10 Mbps.


v For Fast Ethernet, operational bandwidth is 100 Mbps.
v For Gigabit Ethernet, operational bandwidth is 1 Gbps.
Types of Ethernet Networks

Fast Ethernet: As the term suggests, this is quite a high-speed internet, and can transmit or
receive data at about 100 Mbps. This type of network is usually supported by a twisted pair or
CAT5 cable. If a laptop, camera, or any other device is connected to a network, they operate at
10/100Base Ethernet and 100Base on the fiber side of the link.

Gigabit Ethernet: This type of network transfers data at an even higher speed of about 1000
Mbps or 1Gbps. Gigabit speed is an upgrade from Fast Ethernet which is slowly being phased
out. In this type of network, all the four pairs in the twisted pair cable contribute to the data
transfer speed. VERSITRON manufactures Gigabit Ethernet Media Converters that can handle
10/100/1000Base speeds on the Ethernet side and 1000Base Gigabit speed on the fiber side
by using Fiber SFP modules.

10-Gigabit Ethernet: This is an even more advanced and high speed network type with a data
transfer rate of 10 Gigabit/second. It is supported by CAT6a or CAT7 twisted pair cables, as
well as fiber optic cables. By using a fiber optic cable, this network area can be extended up to
around 10,000 meters.

Switch Ethernet: This type of network requires a switch or hub. Also, instead of a twisted pair
cable, a normal network cable is used in this case. Network switches are used for data transfer
from one device to the other, without interrupting any other devices in the network.
Preamble- The following three fields collectively
represents the Ethernet Header–
It is a 7 byte field that contains a pattern of alternating 0’s and 1’s.
It alerts the stations that a frame is going to start. ü Destination Address (6 bytes)
It also enables the sender and receiver to establish bit synchronization. ü Source Address (6 bytes)
ü Length (2 bytes)
Start Frame Delimiter (SFD)- Thus, Ethernet Header Size = 14 bytes.

It is a 1 byte field which is always set to 10101011.


The last two bits “11” indicate the end of Start Frame Delimiter and marks the beginning of the frame.

Destination Address-

It is a 6 byte field that contains the MAC address of the destination for which the data is destined.

Source Address-

It is a 6 byte field that contains the MAC address of the source which is sending the data.

Length-

It is a 2 byte field which specifies the length (number of bytes) of the data field.
This field is required because Ethernet uses variable sized frames.
Data-

It is a variable length field which contains the actual data.


It is also called as a payload field.
The length of this field lies in the range [ 46 bytes , 1500 bytes ].
Thus, in a Ethernet frame, minimum data has to be 46 bytes and maximum data can be 1500 bytes.

Frame Check Sequence (CRC)-

It is a 4 byte field that contains the CRC code for error detection.

q The maximum value that can be accommodated in this field = 65535.


q But it does not mean maximum data that can be sent in one frame is 65535 bytes.
q The maximum amount of data that can be sent in a Ethernet frame is 1500 bytes.
q This is to avoid the monopoly of any single station.
Advantages of Using Ethernet-

v It is not much costly to form an Ethernet network. As compared to other systems of connecting computers,
it is relatively inexpensive.
v Ethernet network provides high security for data as it uses firewalls in terms of data security.
v Also, the Gigabit network allows the users to transmit data at a speed of 1-100Gbps.
v In this network, the quality of the data transfer does maintain.
v In this network, administration and maintenance are easier.
v The latest version of gigabit ethernet and wireless ethernet have the potential to transmit data at the
speed of 1-100Gbps.
Disadvantages of Using Ethernet-

v The wired Ethernet network is used only for short distances.


v The mobility is limited.
v Its maintenance is difficult.
v Ethernet cables, hubs, switches, routers increase the cost of installation.
Limitations of Using Ethernet-

Point-01:

v It can not be used for real time applications.


v Real time applications require the delivery of data within some time limit.
v Ethernet is not reliable because of high probability of collisions.
v High number of collisions may cause a delay in delivering the data to its destination.

Point-02:

v It can not be used for interactive applications.


v Interactive applications like chatting requires the delivery of even very small amount of data.
v Ethernet requires that minimum length of the data must be 46 bytes.

Point-03:

v It can not be used for client server applications.


v Client server applications require that server must be given higher priority than clients.
v Ethernet has no facility to set priorities.
For data transmission-
§ TCP segment sits inside the IP datagram payload field.
§ IP datagram sits inside the Ethernet payload field.
Consider a 10 Mbps Ethernet LAN that has stations attached to a 2.5 km long coaxial cable. Given that the transmission
speed is 2.3 x 108 m/sec, the packet size is 128 bytes out of which 30 bytes are overhead, find the effective transmission
rate and maximum rate at which the network can send data.
Error Control
Error Detection:
When data is transmitted from one device to another device, the system does not guarantee whether the data
received by the device is identical to the data transmitted by another device. An Error is a situation when the
message received at the receiver end is not identical to the message transmitted.
Single-Bit Error: The only one bit of a given data unit is changed from 1 to 0 or from 0 to 1.

Burst Error: The two or more bits are changed from 0 to 1 or from 1 to 0 is known as Burst Error.
Single Parity Check-
In this technique, one extra bit called as parity bit is sent along with the original data bits. Parity bit helps to
check if any error occurred in the data during the transmission.

Step-1:
Step-3:
At sender side,
v To t a l n u m b e r o f 1 ’s i n t h e d a t a u n i t t o b e At receiver side,
transmitted is counted. v Receiver receives the transmitted code word.
v The total number of 1’s in the data unit is made v The total number of 1’s in the received code word is counted.
even in case of even parity.
v The total number of 1’s in the data unit is made odd Then, following cases are possible-
in case of odd parity. ü If total number of 1’s is even and even parity is used, then
v This is done by adding an extra bit called as parity receiver assumes that no error occurred.
bit. ü If total number of 1’s is even and odd parity is used, then
receiver assumes that error occurred.
ü If total number of 1’s is odd and odd parity is used, then
Step-2: receiver assumes that no error occurred.
ü If total number of 1’s is odd and even parity is used, then
v The newly formed code word (Original data + parity receiver assumes that error occurred.
bit) is transmitted to the receiver.
Consider the data unit to be transmitted is 1001001 and even parity is used.
At Sender Side-

q Total number of 1’s in the data unit is counted.


q Total number of 1’s in the data unit = 3.
q Clearly, even parity is used and total number of 1’s is odd.
q So, parity bit = 1 is added to the data unit to make total number of 1’s even.
q Then, the code word 10010011 is transmitted to the receiver.

At Receiver Side-

q After receiving the code word, total number of 1’s in the code word is counted.
q Consider receiver receives the correct code word = 10010011.
q Even parity is used and total number of 1’s is even.
q So, receiver assumes that no error occurred in the data during the transmission.
Advantage-
• This technique is guaranteed to detect an odd number of bit errors (one, three, five and so on).
• If odd number of bits flip during transmission, then receiver can detect by counting the number of 1’s.

Disadvantage-
• This technique can not detect an even number of bit errors (two, four, six and so on).
• If even number of bits flip during transmission, then receiver can not catch the error.

EXAMPLE:
Ø Consider the data unit to be transmitted is 10010001 and even parity is used.
Ø Then, code word transmitted to the receiver = 100100011
Ø Consider during transmission, code word modifies as 101100111. (2 bits flip)
Ø On receiving the modified code word, receiver finds the number of 1’s is even and even parity is used.
Ø So, receiver assumes that no error occurred in the data during transmission though the data is corrupted.
Cyclic Redundancy Check-
Cyclic Redundancy Check (CRC) is an error detection method. It is based on binary division.

Consider the CRC generator is x7 + x6 + x4 + x3 + x + 1.


CRC Generator:

CRC generator is an algebraic polynomial


represented as a bit pattern. Bit pattern
is obtained from the CRC generator using
the following rule-

“The power of each term gives the


position of the bit and the coefficient
gives the value of the bit.”
Thus, for the given CRC
generator, the corresponding
binary pattern is 11011011.
Properties Of CRC Generator-

Rule-01:
It should not be divisible by x.
This condition guarantees that all the burst errors of length
equal to the length of polynomial are detected.
If the CRC generator is chosen according to
the above rules, then-
Rule-02:
It should be divisible by x+1.
v CRC can detect all single-bit errors
This condition guarantees that all the burst errors affecting
v CRC can detect all double-bit errors provided the divisor
an odd number of bits are detected.
contains at least three logic 1’s.
v CRC can detect any odd number of errors provided the
divisor is a factor of x+1.
v CRC can detect all burst error of length less than the
degree of the polynomial.
v CRC can detect most of the larger burst errors with a high
probability.
Step-1: Calculation Of CRC At Sender Step-3: Transmission To Receiver-
Side-
v The newly formed code word (Original data + CRC) is
transmitted to the receiver.
At sender side,
v A string of n 0’s is appended to the data unit to be Step-4: Checking at Receiver Side-
transmitted.
v Here, n is one less than the number of bits in CRC At receiver side,
generator. v The transmitted code word is received.
v Binary division is performed of the resultant string v The received code word is divided with the same
with the CRC generator. CRC generator.
v After division, the remainder so obtained is called as v On division, the remainder so obtained is checked.
CRC.
v It may be noted that CRC also consists of n bits.
Case-01: Remainder = 0
If the remainder is zero, receiver assumes that no error
Step-2: Appending CRC To Data Unit- occurred in the data during the transmission. Receiver
accepts the data.
At sender side,
v The CRC is obtained after the binary division. Case-02: Remainder ≠ 0
v The string of n 0’s appended to the data unit earlier If the remainder is non-zero, receiver assumes that some
is replaced by the CRC remainder. error occurred in the data during the transmission. Receiver
rejects the data and asks the sender for retransmission.
A bit stream 1101011011 is transmitted using the
CRC method. The generator polynomial is
x4+x+1. What is the actual bit string
transmittitted?
• The generator polynomial G(x) = x4 + x + 1 is
encoded as 10011.
• Clearly, the generator polynomial consists of
5 bits.
• So, a string of 4 zeroes is appended to the bit
stream to be transmitted.
• The resulting bit stream is 11010110110000.

From here, CRC = 1110.

Now,
The code word to be transmitted is obtained by replacing
the last 4 zeroes of 11010110110000 with the CRC.
Thus, the code word transmitted to the receiver =
11010110111110.
A bit stream 10011101 is transmitted using the
standard CRC method. The generator
polynomial is x3+1.
a. What is the actual bit string transmitted?
b. Suppose the third bit from the left is
inverted during transmission. How will
receiver detect this error?
• The generator polynomial G(x) = x 3 + 1 is
encoded as 1001.
• Clearly, the generator polynomial consists of
4 bits.
• So, a string of 3 zeroes is appended to the bit
stream to be transmitted.
• The resulting bit stream is 10011101000.

From here, CRC = 100.

Now,
The code word to be transmitted is obtained by replacing
the last 3 zeroes of 10011101000 with the CRC.
Thus, the code word transmitted to the receiver =
10011101100.
According to the question,
Third bit from the left gets inverted
during transmission. So, the bit stream
received by the receiver = 10111101100.

Now,
Receiver receives the bit stream =
10111101100. Receiver performs the
binary division with the same generator
polynomial as-

From here,

The remainder obtained on division is a non-zero value.


This indicates to the receiver that an error occurred in the
data during the transmission.
Therefore, receiver rejects the data and asks the sender for
retransmission.
Checksum-
Step-1:
Case-01: Result = 0
At sender side,
v If m bit checksum is used, the data unit to be transmitted is If the result is zero,
divided into segments of m bits.
Receiver assumes that no error occurred in the data
v All the m bit segments are added.
v The result of the sum is then complemented using 1’s during the transmission. Receiver accepts the data.
complement arithmetic.
v The value so obtained is called as checksum.
Case-02: Result ≠ 0
Step-2:
If the result is non-zero,
v The data along with the checksum value is transmitted to the
receiver. Receiver assumes that error occurred in the data
during the transmission.
Step-03: Receiver discards the data and asks the sender for
retransmission.
At receiver side,
v If m bit checksum is being used, the received data unit is divided
into segments of m bits.
v All the m bit segments are added along with the checksum value.
v The value so obtained is complemented and the result is
checked.
Consider the data unit to be transmitted is- 10011001111000100010010010000100. Consider 8 bit checksum is used.

You might also like