Вы находитесь на странице: 1из 50

COMPUTER NETWORKS CS 306

MODULE II

Page 25
COMPUTER NETWORKS CS 306

Data Link Layer Design Issues


1. Providing a well-defined service interface to the network layer
2. Determining how the bits of the physical layer are grouped into frames
3. Dealing with transmission errors
4. Regulating the flow of frames so that slow receivers are not swamped by fast senders.

The data link layer takes the


packets it gets from the network layer
and encapsulates them into frames for
transmission. Each frame contains a
frame header, a payload field for
holding the packet, and a frame trailer

1. Services Provided to the Network Layer

 The function of the data link layer is to provide service to the network layer.
 The principal service is transferring data from the network layer on the source machine to the network
layer on the destination machine.
 The data link layer can be designed to offer various services, Three possibilities that are commonly provided
are:

1. Unacknowledged connectionless service.


2. Acknowledged connectionless service.
3. Acknowledged connection-oriented service.

Unacknowledged connectionless service

Unacknowledged connectionless service consists of having the source machine send independent frames to
the destination machine without having the destination machine acknowledge them. No connection is established
beforehand or released afterward. Good channels with low error rates, for real-time traffic, such as speech.
Example: Ethernet, Voice over IP, etc.
Acknowledged connectionless service
When this service is offered, there are still no connections used, but each frame sent is individually
acknowledged. This way, the sender knows whether or not a frame has arrived safely. Good for unreliable channels,
such as wireless.

Acknowledged connection-oriented service

With this service, the source and destination machines establish a connection before any data are
transferred. Each frame sent over the connection is numbered, and the data link layer guarantees that each frame
Page 26
COMPUTER NETWORKS CS 306

sent is received. Furthermore, it guarantees that each frame is received exactly once and that all frames are
received in the right order.

When connection-oriented service is used, transfers have three distinct phases.

1. In the first phase the connection is established by having both sides initialize variable and counter need
to keep track of which frames have been received and which ones have not.
2. In the second phase, one or more frames are actually transmitted.
3. In the third phase, the connection is released, freeing up the variables, buffers, and other resources used
to maintain the connection.
2. Framing

 In order to provide service to the network layer, the data link layer must use the service provided to it by
the physical layer.
 What the physical layer does is accept raw bit stream and attempt to deliver it to the destination. This bit
stream is not guaranteed to be error free.
 It is up to the data link layer to detect, and if necessary, correct errors.
 The usual approach is for the data link layer to break the bit stream up into discrete frames and compute
the checksum for each frame. When the frames arrive at the destination , the checksum is re-computed.
There are four methods of breaking up the bit stream
1. Character count.
2. Starting and ending character stuffing.
3. Starting and ending flags, with bit stuffing.
4. Physical layer coding violations.

Character count

Character count uses a field in the header to specify the number of characters in the frame. When the data
link layer at the destination sees the character count, it knows how many characters follow.

Problem: count can possible be misrepresented by a transmission error. This method is rarely used anymore.

Page 27
COMPUTER NETWORKS CS 306

Starting and ending character stuffing /Flag bytes with byte stuffing

It gets around the problem of resynchronization after an error by having each frame start and end with
special bytes.
o The sender inserts a special byte (ESC-Escape Character) just before each flag byte in the data.
o Beginning and ending byte in the frame are called flag byte.
o The receiver’s link layer removes this special byte before the data are given to the network layer.

Fig (a) Frame delimited by flag bytes (b) Four examples of byte sequences before and after byte stuffing.

Two consecutive flag bytes indicate the end of one frame and start of the next one.

Problem occurs with this method when binary data, such as object programs or floating-point numbers, are
being transmitted. It may easily happen that the flag byte's bit pattern occurs in the data.

One way to solve this problem is to have the sender's data link layer insert a special escape byte (ESC) just
before each ''accidental'' flag byte in the data. The data link layer on the receiving end removes the escape byte
before the data are given to the network layer. This technique is called byte stuffing or character stuffing. Thus, a
framing flag byte can be distinguished from one in the data by the absence or presence of an escape byte before it.

Starting and ending flags with bit stuffing

It allows data frames to contain and arbitrary number of bits and allows character codes with an arbitrary
number of bits per character. Each frame begins and ends with a special bit pattern, 01111110, called a flag byte.

Page 28
COMPUTER NETWORKS CS 306

Whenever the sender's data link layer


encounters five consecutive ones in the data, it
automatically stuffs a 0 bit into the outgoing bit
stream, which is called bit stuffing. The receiving
machine destuffs the 0 bit.

Physical coding violations

It is only applicable to networks in which the encoding on the physical medium contains some redundancy.
For example, some LANs encode 1 bit of data by using 2 physical bits.

Qus 1: Why the whole message is not packed in one frame?

Ans: Large frame makes flow and error-control very inefficient. Even a single-bit error requires the re-
transmission of the whole message.
When a message is divided into smaller frames, a single-bit error affects only that small frame.

3. Error Control

 The next problem to deal with is to make sure all frames are eventually delivered to the network layer at
the destination, and in proper order.

 The usual way to ensure reliable delivery is to provide the sender with some feedback about what is
happening at the other end of the line.

Error control in the data link layer is based on automatic repeat request, which is the retransmission of data.

 Error control Mechanisms:


❑ Ack/Nak: Provide sender some feedback about other end
❑ Time-out: for the case when entire packet or ack is lost
❑ Sequence numbers: to distinguish retransmissions from originals

 The whole issue of managing the timers and sequence numbers so as to ensure that each frame is
ultimately passed to the network layer at the destination exactly one, no more no less, is an important part
of the data link layer's duties.

4. Flow Control
Flow control refers to a set of procedures used to restrict the amount of data that the sender can send
before waiting for acknowledgment. Flow control coordinates the amount of data that can be sent before
receiving acknowledgment and is one of the most important duties of the data link layer. It ensures that slow
receiver is not being flooded by fast sender.

Two methods have been developed to control flow of data across communications links:
1. Stop and Wait 2. Sliding Window

Page 29
COMPUTER NETWORKS CS 306

Stop and wait

This is the simplest form of flow control where a sender transmits a data frame. The sender sends one data
frame, waits for acknowledgement (ACK) from receiver .Only after getting the ACK, sender will sent the next frame.

Major drawback of Stop-and-Wait Flow Control is that only one frame can be in transmission at a time, this
leads to inefficiency if propagation delay is much longer than the transmission delay.

Link Utilization in Stop-and-Wait

Let us assume the following:

Transmission time: The time it takes for a station to transmit a frame (normalized to a value of 1).

Propagation delay: The time it takes for a bit to travel from sender to receiver (expressed as a).

– a < 1 : The frame is sufficiently long such that the first bits of the frame arrive at the destination before the
source has completed transmission of the frame.

– a > 1: Sender completes transmission of the entire frame before the leading bits of the frame arrive at the
receiver.

– The link utilization U = 1 / (1 + 2a), where, a = Propagation time / transmission time

To improve the link utilization, we can use the following (sliding-window) protocol instead of using stop-
and-wait protocol.

Sliding Window Protocol

A universally accepted flow control procedure is the sliding window protocol.

Idea: allow multiple frames to transmit


 A window size of N implies buffer space for N frames
 Receiver has a buffer of N frames
 Transmitter can send up to N frames without receiving ACK
 So the link is utilized in a more efficient manner
 Each data frame carries a sequence number for its identification
 ACK includes the sequence number of the next expected frame by the receiver.

Page 30
COMPUTER NETWORKS CS 306

 All the previous data frames are assumed acknowledged on receipt of an acknowledgement

– Sender maintains a list of sequence numbers (frames) it is allowed to transmit, called sending window
– Receiver maintains a list of sequence numbers it is prepared to receive, called receiving window

For n-bit sequence number, we have 2 n numbers: 0, 1, · · · , 2n − 1, but the maximum window size N = 2n − 1

Sending window and receiving window

Sending window

 Sending window maintains sequence numbers of frames sent out but not acknowledged and frames
which are next to be transmitted.
 At the beginning of a transmission, the sender’s window contains n frames.
 As frames are sent out, the left boundary of the window moves inward, shrinking the size of the window.
 Once an ACK arrives, the window expands to allow in a number of new frames equal to the number of
frames acknowledged by that ACK.

Receiving window

 The receiver window maintains the set of frames permitted to accept.


 At the beginning of transmission, the receiver window contains n spaces for frames.
 As new frames come in, the size of the receiver window shrink
 As each ACK is sent out, the receiving window expands to include as many new placeholders as
newly acknowledged frames

Qus 2 : Explain the various Datalink layer design issues.

DATA LINK LAYER PROTOCOLS

Page 31
COMPUTER NETWORKS CS 306

Elementary Data Link Protocols

 An Unrestricted Simplex Protocol


• A Simplex Stop-and-Wait Protocol
• A Simplex Protocol for a Noisy Channel

a) Unrestricted Simplex Protocol.


– Simplex, also known as Utopia.
Sender
– Error-free channel.
– Processing time can be ignored.
– Data transfer is unidirectional.
– Infinite buffer space available.
Receiver
– No flow or error control.
– No sequence number or Acknowledgement number used.
– Both sender receiver network layers are always ready.

b) Simplex Stop and Wait Protocol.


Sender
– Data transfer is unidirectional
– error-free channel
– A finite processing time is essential.
Receiver
– Deals a problem of how to prevent the sender from flooding the receiver with
data faster than its processing speed, using flow control.
– ACK’s are used (automatic repeat request, ARQ)

c) Simplex Protocol for Noisy Channel.( One bit Sliding Window Protocol/Stop & Wait ARQ )

For noisy channel

ARQ provide reliable data transfer service over unreliable networks

i. Stop-and-Wait ARQ

 Source transmits a single frame, and waits for an ACK. If the frame is lost, the source retransmits the
frame.
 Use sequence numbers to number the frames
 The source station is equipped with a timer.
 Keeping a copy of the sent frame and retransmitting of the frame when the timer expires.
 If receiver receives a damaged frame, discard it and the source retransmits the frame.
 If everything goes right, but the ACK is damaged or lost, the source will not recognize it, the source will
retransmit the frame, and receiver gets two copies of the same frame!

Page 32
COMPUTER NETWORKS CS 306

 Solution: use sequence numbers to discard duplicates.

There are different scenarios that can happen:

 Lost / damaged frame


 Lost/ delayed ACK

 Lost / damaged frame

– If error is detected by receiver, it discards the frame and


send a negative ACK (NAK), causing sender to re-send
the frame
– In case a frame never got to receiver, sender has a timer:
each time a frame is sent, timer is set
– If no ACK or NAK is received during timeout period,
it re-sends the frame.

 Lost/ delayed ACK

– In case of lost/ delayed ACK, time out will retransmit the frame.
– Timer introduces a problem: Suppose timeout and sender retransmits a frame but receiver
actually received the previous transmission . Receiver has duplicated copies.
– To avoid receiving and accepting two copies of same frame, frames and ACKs are alternatively
labeled 0 or 1: ACK0 for frame 1, ACK1 for frame 0

Fig: lost ACK frame Fig: delayed ACK frame


Link Utilization:

The link utilization (U) in Stop and wait ARQ is;

U = ( 1 – p ) / (1 + 2a)
where
p is the probability of receiving a bit in error
a is the propagation delay
Page 33
COMPUTER NETWORKS CS 306

a = ( tprop * R) / L where tprop, R and L denotes propagation time , datarate of the link
and number of bits in the frame

Advantage of stop and- wait is simplicity:


• Each frame is checked and acknowledged before the next frame is sent.

Disadvantage of Stop-and-Wait:
• In stop-and-wait, at any point in time, there is only one frame that is sent and waiting to be
acknowledged.
• Stop-and-wait is slow. Each frame must travel all the way to the receiver and an acknowledgment
must travel all the way back before the next frame can be sent.
• This is not a good use of transmission medium.
To improve efficiency, multiple frames should be in transition while waiting for ACK.

Piggybacking

Piggybacking is a method to combine a data frame with an acknowledgment.


Piggybacking is a bi-directional data transmission technique in the network layer. The acknowledgment for
previous frame is sent along with the data request/transfer of current frame.

Suppose the link between receiver and transmitter is full duplex and usually both transmitter and receiver
stations send data to each over. So, instead of sending separate acknowledgement packets, a portion (few bits) of
the data frames can be used for acknowledgement. This phenomenon is known as piggybacking.

• Station A and B both have data to


send.

• Instead of sending separately,


station A sends a data frame that
includes an ACK.

• Station B does the same thing.

Advantages:
 Improves the efficiency
 better use of available channel
bandwidth.


ii. Go-Back-N ARQ

 Based on sliding-window flow control.


 Allows transmission of multiple frames without waiting for acknowledgement.
 Receiver sends positive ACK if a frame arrived safe and in order. (RR: receive ready)
 If the frames are damaged/out of order, the destination will reply with negative ACK (REJ: reject)
 Receiver discards that frame and all future frames, until the erroneous frame is received correctly.
 Source must go back and retransmit that frame and all succeeding frames that were transmitted.
 This makes the receiver simple, but decreases the efficiency

Page 34
COMPUTER NETWORKS CS 306

 The receiver does not have to acknowledge each frame received, it can send one cumulative ACK for
several frames.

In Go-Back-N ARQ,
Size of the sender window must be less than 2 m.
Size of the receiver is always 1.
If m = 3, sender window size = 2m – 1 = 7.

Sender Sliding Window Receiver Sliding Window

Operation

In Go back N ARQ, if one frame is lost or damaged, all frames sent since last frame acknowledged are
retransmitted.
Scenarios:
 Lost / damaged frame
 Lost/ delayed ACK

In Go-Back-N protocol,
the ACK number is cumulative and defines
the sequence number of the next packet expected
to arrive.

 Lost / damaged frame

The sending device keeps a copy of sent frames until the acknowledgements arrive. If a frame is lost/
damaged, the time out mechanism or NAK cause the sender to retransmit all frames since last acknowledged.

 If a frame is lost, out of order frames will receive at receiver. The receiver sends NAK and discards all
subsequent frames until it receives the one it is expecting.
 Then the sender resends all frames, beginning with the one with expired timer.

 Lost/ delayed ACK

 If an ACK is damaged/lost, we can have two situations:

Page 35
COMPUTER NETWORKS CS 306

– If ACK1, ACK2, and ACK3 are lost, ACK4 covers them if it arrives before the timer expires.
– If ACK4 arrives after time-out, the last frame and all the frames after that are resent.

 If the next ACK arrives before the expiration of any timer, there is no need for retransmission of frames
because ACKs are cumulative in this protocol.
 Receiver never resends an ACK.
 A delayed ACK also triggers the resending of frames

Link Utilization:

The link utilization (U) in Go-back-N ARQ is;

1. When N > 2a+1, U = (1 - p) / (1 + 2ap)

2. When N < 2a+1, U = N (1 - p) / [(2a + 1) * (1 – p + Np)]

where
p is the probability of receiving a bit in error
a is the propagation delay
a = ( tprop * R) / L where tprop, R and L denotes propagation time , datarate of the link
and number of bits in the frame
Advantages:

 The sender can send many frames at a time.


 Timer can be set for a group of frames.
 Efficiency is more.
 Waiting time is pretty low.
 Pipelining used (a task is often begun before the previous task has ended)
 Cumulative ACK applicable.

Disadvantages:

 Buffer requirement
 Retransmission of many error-free packets following an erroneous packet
 Scheme is inefficient when round-trip delay large and data transmission rate is high
 If NAK is lost, a long time is wasted until re-transmission of all packets (until another NAK is sent).

iii. Selective Repeat ARQ method

• In Selective Repeat ARQ, only the damaged frame is resent. More bandwidth efficient but more complex
processing at receiver.
• It defines a negative ACK (NAK) to report the sequence number of a damaged frame before the timer
expires.
• Selective Repeat ARQ overcomes the limitations of Go-Back-N by adding 2 new features,
(1) receiver window > 1 frame, so that out-of-order but error-free frames can be accepted
(2) retransmission mechanism is modified – only individual frames are retransmitted. (resends only
selective packets, those that are actually lost)
Send window for Selective Repeat ARQ:

Page 36
COMPUTER NETWORKS CS 306

Receive window for Selective Repeat ARQ:

Size of the sender window = Size of receiver window


Size of the sender window=2m-1 For example : if m = 4 ;
m-1
Size of the receiver window=2 Sequence number : 0 to 15 Window size : 2(4-1) = 23 = 8

Receiver must maintain large enough buffer, and must contain logic for reinserting the retransmitted
frame in the proper sequence

In the selective repeat ARQ,

an ACK number
defines the sequence number
of the error free packet
received

Retransmission mechanism

– Timer: When the timer expires, only the corresponding frame is retransmitted.
– NAK: Whenever an out-of-sequence frame is observed at the receiver, a NAK frame is sent with
sequence number of lost frame. When the transmission receives such a NAK frame, it retransmits
the specific frame.
Scenarios:
 Lost / damaged frame
 Lost/ delayed ACK

Link Utilization:

The link utilization (U) in Selective repeat ARQ is;

Page 37
COMPUTER NETWORKS CS 306

1. When N ≥ 2a+1, U=1-p

2. When N < 2a+1, U = [N * (1 - p)] / (2a + 1)

where
p is the probability of receiving a bit in error
a is the propagation delay
a = ( tprop * R) / L where tprop, R and L denotes propagation time , datarate of the link
and number of bits in the frame
Advantages :

 It reduces number of retransmissions for noisy links


 Less duplication
 Better Performance.
 Pipelining used.
 Cumulative ACK applicable

Disadvantages :

 The receiver and transmitter processing logic is more complex


 Receiver may receive frames out of sequence
 Receiver must be able to reinsert the retransmitted (lost, delayed, damaged) frame in the proper
sequence after it arrives
 Needs more memory than Go-Back-N ARQ at the receiver side.

Qus 3: Explain the following datalink protocols.


a) Unrestricted Simplex Protocol.
b) Simplex Stop and Wait Protocol.
c) Simplex Protocol for Noisy Channel.

Qus 4 : Briefly explain stop -and-wait and selective repeat ARQ method of flow control.

Qus 5 : Compare Go back N and Selective Repeat sliding window protocol used in DLL.

Qus 6 : Explain the Go back-n sliding window protocol.


Qus 7: What do you meant by a bit-oriented and byte-oriented protocol?

Bit- Oriented protocol

 The data received from the upper layers whether text, images, audio or video is carried in the form of
bits; the data field of each frame comprises a sequence of bits.

 To distinguish each frame, a special 8-bit pattern flag 01111110 is used at the beginning and end of the
each frame.

 In case the flag pattern appears in the data field of frame, bit stuffing is used at sender’s end.

 After each five consecutive 1s in data, an extra bit 0 is inserted to prevent the bit pattern from looking
like a flag. The extra bit stuffed by the sender is then destuffed at the receivers end.

Page 38
COMPUTER NETWORKS CS 306

 An example of bit oriented protocol is HDLC (High-Level Data Link Control) protocol
Original data

Bit Stuffing

The data stored in receiver’s memory


after destuffing.

Byte - Oriented protocol / Character - Oriented protocol

 The data received from the upper layers whether text, images, audio or video is carried in the form of
bytes such as ASCII. Each frame comprises a sequence of bytes.

 To distinguish each frame, a special 1-byte flag is used at the beginning and end of the each frame; the
flag is usually comprises of special characters depending on the protocol being used.

 In case the flag byte appears in the data field of frame, byte stuffing is used at sender’s end.

 An extra byte called escape character(ESC), is stuffed in the data when there appears a character with
the same pattern as flag. The extra byte stuffed by the sender is then destuffed at the receivers end.

 An example of byte oriented protocol is PPP (Point-to-point) protocol

Fig (a): Frame delimited by flag bytes (b) Four examples of byte sequences before and after byte stuffing.

HDLC (High-Level Data Link Control)

HDLC is a bit-oriented protocol for communication over point-to-point and multipoint links. It was
developed by the International Standards Organization (ISO). It specifies a packetization standard for serial links.
One of the most common datalink layer protocols is the HDLC protocol.
Features :
i. Reliable protocol (selective repeat or go-back-N)
ii. provides both connectionless service and connection oriented services
iii. Full-duplex communication (receive and transmit at the same time)
iv. Bit-oriented protocol
v. Flow control (adjust window size based on receiver capability).

Page 39
COMPUTER NETWORKS CS 306

vi. Uses physical layer clocking and synchronization to send and receive frames

To satisfy a variety of applications, HDLC defines three types of stations, two link configurations, and three
data-transfer modes of operation.

 Stations:

 Primary : sends data, controls the link with commands; handles error recovery.
 Secondary : receives data, responds to control messages;
The primary station maintains a separate logical link with each secondary station.
 Combined : can issue both commands and responses;

 Link configuration:

 Unbalanced: one primary station, one or more secondary stations


 Balanced: two combined stations ; Supports both full-duplex and half-duplex transmission

 Data transfer modes

 Normal response mode (NRM):

 Used with unbalanced configuration


 Primary initiates data transfer; secondary can only reply
 Two common configurations
- Point-to-Point link (one primary and one secondary station)
- Multipoint link (primary station maintain different sessions with different
secondary stations)

 Asynchronous balanced mode (ABM):


 Used with balanced configurations
 Either side may send data at any time.

 Asynchronous response mode (ARM):


 Used with an unbalanced configuration.
 The secondary may initiate transmission without explicit permission of the primary.

HDLC Frame Format

Each type of frame serves as an envelope for the transmission of a different type of message.

Page 40
COMPUTER NETWORKS CS 306

Flag Fields:

 Flag fields delimit the frame at both ends with the unique pattern 01111110. A single flag may be used
as the closing flag for one frame and the opening flag for the next.

 The pattern 01111110 could be found inside a frame and thus using it as a delimiter will destruct
inner structure of the frame. Thus a method name Bit Stuffing was used in which sender will insert 0
after occurrence of 5 consecutive 1’s.

With the use of bit stuffing, arbitrary bit patterns can be inserted into the data field of the frame. This
property is known as data transparency.

Address Field :

 The address field identifies the secondary station that transmitted or is to receive the frame. This field is
not needed for point-to-point links, but is always included for the sake of uniformity.

 The single-octet address of 11111111 is interpreted as the all-stations address

Control Field :

 Three main types of frames :

1) Information frames (I-frames) transport user data and control information relating to user data (piggybacking).

 The first bit defines the type. If the first bit of the control field is 0, this means the frame is an I-frame.
• The next 3 bits, called N(S), define the sequence number of the frame.
• The last 3 bits, called N(R), correspond to the acknowledgment number when piggybacking is used.
• The single bit between N(S) and N(R) is called the P/F bit.
The P/F field is a single bit with a dual purpose.

Page 41
COMPUTER NETWORKS CS 306

o when it is set (bit = 1) means poll. It means poll when the frame is sent by a primary station to a
secondary (when the address field contains the address of the receiver).
o when it is set (bit = 0) means final when the frame is sent by a secondary to a primary (when the
address field contains the address of the sender).

2) Supervisory frames (S-frames) provide the ARQ mechanism when piggybacking is not used. S-frames do not
have information fields.

• If the first 2 bits of the control field is 10, this means the frame is an S-frame.
• The last 3 bits, called N(R), corresponds to the acknowledgment number (ACK) or negative acknowledgment
number (NAK) depending on the type of S-frame.
• The 2 bits called code is used to define the type of S-frame itself. With 2 bits, there are four types of
S-frames
• The fifth field in the control field is the P/F.

1. Receive ready (RR).- If the value of the code subfield is 00, it is an RR S-frame. This kind of frame
acknowledges the receipt of a frame or group of frames. In this case, the value N(R) field defines the
acknowledgment number.

2. Receive not ready (RNR).- If the value of the code subfield is 10, it is an RNR S-frame. It acknowledges the
receipt of a frame or group of frames, and it announces that the receiver is busy and cannot receive more
frames. It acts as a kind of congestion control mechanism by asking the sender to slow down. The value of
N(R) is the acknowledgment number.

3. Reject (REJ).- If the value of the code subfield is 01, it is a REJ S-frame. It is a NAK that can be used in Go-
Back-N ARQ to improve the efficiency of the process by informing the sender, before the sender time
expires, that the last frame is lost or damaged. The value of N(R) is the negative acknowledgment number.

4. Selective reject (SREJ).- If the value of the code subfield is 11, it is an SREJ S-frame. This is a NAK frame used
in Selective Repeat ARQ. The value of N(R) is the negative acknowledgment number.

3) Unnumbered frames (U-frames) are used to exchange session management and control information between
connected devices.

U-frames contain an information field, but used for system management information, not user data. U-
frame codes are divided into two sections:
• a 2-bit prefix before the P/F bit
• a 3-bit suffix after the P/F bit.
Together, these two segments (5 bits) can be used to create up to 32 different types of U-frames.

Information Field:

 The information field is present only in I-frames and some U-frames.

 The field can contain any sequence of bits but must consist of an integral number of octets.

FCS Field:

Page 42
COMPUTER NETWORKS CS 306

 The frame check sequence (FCS) is an error-detecting code calculated from the remaining bits of the
frame, exclusive of flags. The normal code is the 16-bit CRC CCITT . An optional 32-bit FCS, using
CRC-32, may also be used.

PPP(Point-to-point protocol)

PPP is a protocol that can be used to establish communication between any two communicating devices
that need to exchange information. Information is exchanged in the form of structured data packets. The point-to-
point links that utilize this protocol should be able to support full-duplex communication. PPP can be fragmented
into three parts:
1. Encapsulation
2. Link Control Protocol (LCP)
3. Network Control Protocol (NCP)

 Encapsulation
Encapsulation is provided by PPP so that different protocols at the network layer can be supported
simultaneously. Data is sent in frames. Data is transmitted from the left to right.

The PPP frame format

The fields of a PPP frame are as follows:

• Flag—A single byte that indicates the beginning or end of a frame. The flag field consists of the binary
sequence 01111110.

• Address—A single byte that contains the binary sequence 11111111, the standard broadcast address.
PPP does not assign individual station addresses.

 Control—A single byte that contains the binary sequence 00000011, which calls for transmission of user
data in an unnumbered frame.

 Protocol—2 bytes that identify the protocol encapsulated in the information field of the frame.

 Data—Zero or more bytes that contain the datagram for the protocol specified in the protocol field. The
default maximum length of the information field is 1,500 bytes.

 Frame check sequence (FCS)—Normally 16 bits (2 bytes).


The LCP can negotiate modifications to the standard PPP frame structure.

PPP phases :

A simplified phase diagram for bring a line up and down.

Page 43
COMPUTER NETWORKS CS 306

Link Dead

The protocol starts with the line in the DEAD state, which means that no physical layer carrier is
present and no physical layer connection exists. After physical connection is established, the line moves to
ESTABLISH.

Link Establishment Phase

This phase is where Link Control Protocol negotiation is attempted. If successful, control goes either
to the authentication phase or the Network-Layer Protocol phase, depending on whether authentication is
desired.
When one of the end machines starts, the connection goes to the establishing state. LCP negotiates
data link protocol options for establishing the link. It also provides a way for the two processes to test the
line quality to see if they consider it good enough to set up a connection.

Authentication Phase

This phase is optional. It allows the sides to authenticate each other with username and password.
If successful, control goes to the network-layer protocol phase. Here, the two parties can check on each
other's identities if desired.

Network-Layer Protocol Phase

This phase is where each desired protocols' Network Control Protocols are invoked. For example,
IPCP is used in establishing IP service over the line.
The connection remains in this state until one of the endpoints wants to terminate the connection.
Closing down of network protocols also occur in this phase. Some examples of NLPs are Internet Protocol
(IP), AppleTalk (AT) etc. The corresponding NCPs are Internet Protocol Control Protocol (IPCP) for IP,
AppleTalk Control Protocol (ATCP) for AT etc.
If the configuration is successful, OPEN is reached and data transports can take place. When data
transport is finished, the line moves into the TERMINATE phase, and from there, back to DEAD when the
carrier is dropped.

Link Termination Phase

Finally, the LCP protocol also allows lines to be taken down when they are no longer needed. This
phase closes down the connection. This can happen if there is an authentication failure, if there are so

Page 44
COMPUTER NETWORKS CS 306

many checksum errors that the two parties decide to tear down the link automatically, if the link suddenly
fails, idle period timeout or if the user decides to hang up his connection.

Qus 8: Explain the frame format for HDLC protocol.


Qus 9: Briefly explain the High Level DataLink Control (HDLC) protocol with neat labeled diagrams.
Qus 10: Explain the datalink layer protocol used in the Internet -PPP.
Qus 11: Discuss the various phases for bringing a line up and down using PPP.

Qus 12:Generate a polynomial code checksum for the following data :


Data Frame : 1101011011
Generator : 10011

Bitstream : 1101011011
Divisor : 10011
Message after appending zeros : 11010110110000
At sender side:

At the receiver side, the bit string is checked for error.

Page 45
COMPUTER NETWORKS CS 306

Qus 13 : If the bit string 0111101111101111110 is bit stuffed. What is the output string?

The output is 011110111110011111010

Qus 14 : Explain any one error correcting codes used by the datalink layer.

Error Correcting Code:

Error Correcting Code can be handled in two ways:


1) Receiver can have the sender retransmit the entire data unit.
2) The receiver can use an error-correcting code, which automatically corrects certain errors.

One method is Hamming Code,

Hamming codes are code words formed by adding redundant check bits, or parity bits, to a data word. A
Hamming code is a linear error-correcting code named after its inventor, Richard Hamming. Hamming codes can
detect up to two bit errors, and correct single-bit errors.
Number of redundancy bits needed
• Let data bits = m1
• Redundancy bits = r
\ Total message sent = m+r
The value of r must satisfy the following relation:
2r ≥ m+r+1
The structure of the encoder and decoder for a Hamming code
At sender side, Parity checks are created
as follows (using modulo-2)
r0 = a2 + a1 + a0
Example: r1 = a3 + a2 + a1
r2 = a1 + a0 + a3
At receiver side, the checker in the
decoder creates a 3-bit syndrome
(s2s1s0).
s0 = b2 + b1 + b0 + q0
s1 = b3 + b2 + b1 + q1
s2 = b1 + b0 + b3 + q2

Page 46
COMPUTER NETWORKS CS 306

Consider databit 6 is changed from 0 to 1.


At receiver side the word fetched as,

0110 = 6 è bit position 6 is wrong, i.e. bit D3 is wrong

Thus the error is identified and can correct it by inverting the desired bit.

MAC Sublayer
• Point-to-point links – E.g. PPP for dial-up access, or point-to-point link between Ethernet switch and host
• Broadcast links (shared wire or medium) – E.g. traditional Ethernet, or 802.11 wireless LAN (WiFi)

 In broadcast networks, several stations share a single communication channel.


 The major issue in these networks is, which station should transmit data at a given time.
 This process of deciding the turn of different stations is known as Channel Allocation.
 To coordinate the access to the channel, multiple access protocols are required.
 All these protocols belong to the MAC sublayer.

 Data Link layer is divided into two sublayers:


o Logical Link Control (LLC)
o Medium Access Control (MAC)
 LCC is responsible for error control & flow control.
 MAC is responsible for multiple access resolutions.

Page 47
COMPUTER NETWORKS CS 306

Channel Allocation Problem

 In broadcast networks, single channel is shared by several stations. This channel can be allocated to only
one transmitting user at a time.
 There are two different methods of channel allocations:
o Static Channel Allocation
o Dynamic Channel Allocation

Static Channel Allocations

In this method, a single channel is divided among various users either on the basis of frequency or on
the basis of time.
It either uses FDM (Frequency Division Multiplexing) or TDM (Time Division Multiplexing).
In FDM, fixed frequency is assigned to each user, whereas, in TDM, fixed time slot is assigned to each
user.

Dynamic Channel Allocation

In this method, no user is assigned fixed frequency or fixed time slot.
All users are dynamically assigned frequency or time slot, depending upon the requirements of the user.

Multiple Access Protocols


 Many protocols have been defined to handle the access to shared link.
 These protocols are organized in three different groups:
– Random Access Protocols
– Controlled Access Protocols
– Channelization Protocols

Random Access Protocols

• It is also called Contention Method.


• In this method, there is no control station.
• Any station can send the data.
• The station can make a decision on whether or not to send data. This decision depends on the state of the
channel, i.e. channel is busy or idle.
• There is no scheduled time for stations to transmit. They can transmit in random order.
• There is no rule that decides which station should send next.
• If two stations transmit at the same time, there is collision and the frames are lost.

• The various random access methods are:


o ALOHA
o CSMA (Carrier Sense Multiple Access)
o CSMA/CD (Carrier Sense Multiple Access with Collision Detection)
o CSMA/CA (Carrier Sense Multiple Access with Collision Avoidance)

Page 48
COMPUTER NETWORKS CS 306

ALOHA
• ALOHA was developed at University of Hawaii in early 1970s by Norman Abramson.
• It was used for ground based radio broadcasting.
• In this method, stations share a common channel.
• When two stations transmit simultaneously, collision occurs and frames are lost.

 Pure ALOHA
• In pure ALOHA, stations transmit frames whenever they have data to send.
• When two stations transmit simultaneously, there is collision and frames are lost.
• In pure ALOHA, whenever any station transmits a frame, it expects an acknowledgement from the receiver.
• If acknowledgement is not received within specified time, the station assumes that the frame has been lost.
• If the frame is lost, station waits for a random amount of time and sends it again.
• This waiting time must be random; otherwise, same frames will collide again and again.
• Whenever two frames try to occupy the channel at the same time, there will be collision and both the
frames will be lost.
• If first bit of a new frame overlaps with the last bit of a frame almost finished, both frames will be lost and
both will have to be retransmitted.
A collision involves two or more stations. If all
these stations try to resend their frames after
the time-out, the frames will collide again.
Pure ALOHA dictates that when the time-out
period passes, each station waits a random
amount of time before resending its frame.
The randomness will help avoid more
collisions. We call this time the back-off time
TB.
Pure ALOHA has a second method to prevent
congesting the channel with retransmitted
frames. After a maximum number of
retransmission attempts Kmax, a station must
give up and try later.

The formula for TB depends on the


implementation. One common formula is the
binary exponential back-off.
Page 49
COMPUTER NETWORKS CS 306

Binary exponential back-of

In this method, for each retransmission, a multiplier in the range 0 to 2K - 1 is randomly chosen and
multiplied by Tp (maximum propagation time) or Tfr (the average time required to send out a frame) to find TB' . In
this procedure, the range of the random numbers increases after each collision. The value of Kmax is usually chosen
as 15.

Vulnerable time:
The vulnerable time is in which there is a possibility of collision. Assume that the stations send fixed-length
frames with each frame taking Tfr s to send.

Throughput:

Let us call G the average number of frames generated by the system during one frame transmission time.
The throughput for pure ALOHA is
S = G × e −2G
The maximum throughput
Smax = 0.184 when G= (1/2).

In other words, if one-half a frame is generated during one frame transmission time (in other words, one
frame during two frame transmission times), then 18.4 percent of these frames reach their destination successfully.

 Slotted ALOHA
• Slotted ALOHA was invented to improve the efficiency of pure ALOHA.
• In slotted ALOHA, time of the channel is divided into intervals called slots.
• The station can send a frame only at the beginning of the slot and only one frame is sent in each slot.
• If any station is not able to place the frame onto the channel at the beginning of the slot, it has to wait until
the next time slot.
• There is still a possibility of collision if two stations try to send at the beginning of the same time slot.

The vulnerable time is now reduced to one-half,

Page 50
COMPUTER NETWORKS CS 306

equal to Tfr.

Throughput:
It can be proved that the average number of successful
transmissions for slotted ALOHA is
S = G x e-G.
The maximum throughput Smax is 0.368, when G = 1. In
other words, if a frame is generated during one frame
transmission time, then 36.8 percent of these frames reach
their destination successfully.

Carrier Sense Multiple Access (CSMA)


• SMA was developed to overcome the problems of ALOHA i.e. to minimize the chances of collision.
• CSMA is based on the principle of “carrier sense”.
• The stations sense the carrier or channel before transmitting a frame.
• It means the station checks whether the channel is idle or busy.
• The chance of collision reduces to a great extent if a station checks the channel before trying to use it.

Need to transmit

No
Idle
?
Yes
Transmit

• The chance of collision still exists because of propagation delay.


• The frame transmitted by one station takes some time to reach the other station.
• In the meantime, other station may sense the channel to be idle and transmit its frames.
• This results in the collision.
There are three different types of CSMA protocols/ persistent methods:

 1-Persistent CSMA
 Non-Persistent CSMA
 P-Persistent CSMA

1-Persistent CSMA

• In this method, station that wants to transmit data, continuously senses the channel to check whether
the channel is idle or busy.

Page 51
COMPUTER NETWORKS CS 306

• If the channel is busy, station waits until it becomes idle.


• When the station detects an idle channel, it immediately transmits the frame.
• This method has the highest chance of collision because two or more stations may find channel to be
idle at the same time and transmit their frames.

Non-Persistent CSMA

• A station that has a frame to send senses the channel.


• If the channel is idle, it sends immediately.
• If the channel is busy, it waits a random amount of time and then senses the channel again.
• It reduces the chance of collision because the stations wait for a random amount of time.
• It is unlikely that two or more stations will wait for the same amount of time and will retransmit at the same
time.

P-Persistent CSMA

• In this method, the channel has time slots such that the time slot duration is equal to or greater than the
maximum propagation delay time.
• When a station is ready to send, it senses the channel.
• If the channel is busy, station waits until next slot.
• If the channel is idle, it transmits the frame.
• It reduces the chance of collision and improves the efficiency of the network.

CSMA with Collision Detection (CSMA/CD)


• In this protocol, the station senses the channel before transmitting the frame. If the channel is busy, the
station waits.
• Additional feature in CSMA/CD is that the stations can detect collisions.

Page 52
COMPUTER NETWORKS CS 306

• The stations abort their transmission as soon as they detect collision.


• This feature is not present in CSMA.
• The stations continue to transmit even though they find that collision has occurred.
• In CSMA/CD, transmission and collision detection is a continuous process.
• The persistence process sense the channel before starts the sending of frame (nonpersistent,
I-persistent, or p-persistent).

• The throughput of CSMA/CD is greater than that of pure or slotted ALOHA.

• In CSMA/CD, the station that sends its data on the channel, continues to sense the channel even after data
transmission.
• If collision is detected, the station aborts its transmission and waits for a random amount of time & sends
its data again.
• As soon as a collision is detected, the transmitting station releases a jam signal.
• Jam signal alerts other stations. Stations are not supposed to transmit immediately after the collision has
occurred.

CSMA with Collision Avoidance (CSMA/CA)


• This protocol is used in wireless networks because they cannot detect the collision.
• So, the only solution is collision avoidance.
• It avoids the collision by using three basic techniques:
 Interframe Space
 Contention Window
 Acknowledgements.

Page 53
COMPUTER NETWORKS CS 306

Interframe Space

• Whenever the channel is found idle, the station does not transmit immediately.
• It waits for a period of time called Interframe Space (IFS).
• When channel is sensed idle, it may be possible that some distant station may have already started
transmitting.
• Therefore, the purpose of IFS time is to allow this transmitted signal to reach its destination.
• If after this IFS time, channel is still idle; the station can send the frames.
Contention Window

• Contention window is the amount of time divided into slots.


• Station that is ready to send chooses a random number of slots as its waiting time.
• The number of slots in the window changes with time.
• It means that it is set of one slot for the first time, and then doubles each time the station cannot detect an
idle channel after the IFS time.
• In contention window, the station needs to sense the channel after each time slot.

Acknowledgment

• Despite all the precautions, collisions may occur and destroy the data.
• Positive acknowledgement and the time-out timer help guarantee that the receiver has received the frame.

Page 54
COMPUTER NETWORKS CS 306

Controlled Access Protocol


• In this method, the stations consult each other to find which station has a right to send.
• A station cannot send unless it has been authorized by other station.
• The different controlled access methods are:
o Reservation
o Polling
o Token Passing1

Reservation

• In this method, a station needs to make a reservation before sending data.


• The time is divided into intervals. In each interval, a reservation frame precedes the data frames sent in that
interval.
• If there are N stations, then there are exactly N reservation slots in the reservation frame.
• Each slot belongs to a station.
• When a station needs to send a frame, it makes a reservation in its own slot.
• The stations that have made reservations can send their frames after the reservation frame.

Polling

Page 55
COMPUTER NETWORKS CS 306

• Polling method works in those networks where primary and secondary stations exist.
• All data exchanges are made through primary device even when the final destination is a secondary device.
• Primary device controls the link and secondary device follow the instructions.

Token Passing
• Token passing method is used in those networks where the stations are organized in a logical ring.
• In such networks, a special packet called token is circulated through the ring.
• Station that possesses the token has the right to access the channel.
• Whenever any station has some data to send, it waits for the token. It transmits data only after it gets the
possession of token.
• After transmitting the data, the station releases the token and passes it to the next station in th ring.
• If any station that receives the token has no data to send, it simply passes the token to the next station in
the ring.

Channelization Protocol
• Channelization is a multiple access method in which the available bandwidth of a link is shared in time,
frequency or code between different stations.
• There are three basic channelization protocols:
 Frequency Division Multiple Access (FDMA)
 Time Division Multiple Access (TDMA)
 Code Division Multiple Access (CDMA)

IEEE 802 for LANs and MANs


In 1985, the Computer Society of the IEEE started a project, called Project 802 , to set standards to enable
intercommunication among equipment from a variety of manufacturers
.
• The 802 standards define the Physical and MAC layers of LAN and MAN connectivity
• IEEE 802 is a family of IEEE ( Institute of Electrical and Electronics Engineers, Inc.) standards dealing
with local area networks and metropolitan area networks.
• These mutually compatible standards work together at the Data Link layer

Page 56
COMPUTER NETWORKS CS 306

• The IEEE 802 standards are further divided into many parts. Some are,
IEEE 802.1 Bridging (networking) and Network Management
IEEE 802.2 Logical link control (upper part of data link layer)
IEEE 802.3 Ethernet (CSMA/CD)
IEEE 802.4 Token bus
IEEE 802.5 Defines the MAC layer for a Token Ring
IEEE 802.11 Wireless LAN (CSMA/CA)
IEEE 802.15 Wireless PAN
IEEE 802.15.1 (Bluetooth certification)
IEEE 802.16 Broadband Wireless Access (WiMAX certification)

The 802.1 sublayer gives an introduction to set of standards and gives the details of the interface
primitives. It provides relationship between the OSI model and the 802 standards.
The 802.2 sublayer describes the LLC (logical link layer). It is used with the 802.3, 802.4, and 802.5
standards (lower DL sublayers)."

LLC (Logical link control) and MAC (Media Access Control)

The IEEE has subdivided the data link layer into two sublayers: logical link control (LLC) and media access
control (MAC).

LLC (Logical Link Control)

 The subframe is called IEEE 802.2


 Provides error and flow control if needed
 It makes the MAC sublayer transparent
 Used to multiplex multiple network layer protocols in the data link layer frame

Page 57
COMPUTER NETWORKS CS 306

 LLC provides one single data link control protocol for all IEEE LANs.
 Implemented in software

MAC (media access control)


 The frame is called IEEE 802.3
 Handles framing, MAC addressing, Medium Access control
 Specific implementation for each LAN protocol (defines different protocols for different LANs)
 Defines CSMA/CD as the access method for Ethernet LANs , Token passing method for Token Ring
and Token Bus LANs.
 Implemented in hardware
Framing is handled in both the LLC and MAC sublayer.

IEEE defines detailed specifications for each LAN implementation.


Name Description
IEEE 802.3 Ethernet
IEEE 802 Series of LAN Standards  IEEE 802.4 Token bus
IEEE 802.5 Token Ring
IEEE 802.11a/b/g/n Wireless LAN
IEEE 802.15.1 Bluetooth

IEEE 802.3 Ethernet (CSMA/CD)

The original Ethernet was created in 1976 at Xerox’s Palo Alto Research Center (PARC). Ethernet is a LAN
protocol that is used in Bus and Star topologies and implements CSMA/CD as the medium access method.

Ethernet Provides Unreliable, connectionless Service


 Ethernet data link layer protocol provides connectionless service to the network layer
 No handshaking between sending and receiving adapter.
 Ethernet protocol provides Unreliable service to the network layer :
 Receiving adapter doesn’t send ACK or NAK to sending adapter

Ethernet has gone through four generations.

In Standard Ethernet, the MAC sublayer governs the operation of the access method. It also frames data
received from the upper layer and passes them to the physical layer.

Standard Ethernet uses CSMA/CD with 1-persistent.Ethernet architecture can be divided into two layers:

Data link layer:

Page 58
COMPUTER NETWORKS CS 306

Following are the major functions of this layer.

• Station interface
• Data Encapsulation /Decapsulation
• Link management
• Collision Management

Physical layer:
This layer takes care of following functions.

• Encoding and decoding


• Collision detection
• Carrier sensing
• Transmission and receipt

802.3 MAC frame

The IEEE 802.3 standard defines a basic data frame format that is required for all MAC implementations.

Preamble:

 7bytes (56 bits); Alternating 0s and 1s(10101010) used for synchronization

Start Frame Delimiter (SFD):

 10101011 indicates the start of the frame.


 Last two bits (11) alerts that the next field is destination address.
preamble and SFD are added at the physical layer and is not formally part of the frame

Destination address (DA):

 It consists of 6 bytes.
 The DA field identifies which station(s) should receive the frame.

Page 59
COMPUTER NETWORKS CS 306

Source addresses (SA):

 It consists of 6 bytes.
 The SA field identifies the sending station.
 The SA is always an individual address and the left-most bit in the SA field is always 0.
Length/Type:

 It consists of 4 bytes.
 This field defines the upper-layer protocol using the MAC frame.
OR
 defines the number of bytes in the data filed.

Data:

 minumum: 46 and maximum : 1500 bytes

Minimum and maximum lengths

Minimum frame length restriction(64 bytes) is required for the correct operation of CSMA/CD.

Min data length =64 -18 (ie, 6+6+2+4) =46 bytes


If the upper-layer packet is less than 46 bytes, padding is added to make up the difference.

Maximum length restriction;two historical reasons:

 Memory was very expensive when Ethernet was designed.


 Prevents one station from monopolizing the shared medium, blocking other stations that have data to sent.

Max data length =1518-18= 1500 bytes.

CRC:

Page 60
COMPUTER NETWORKS CS 306

 error detection information:CRC-32

Addressing

Each station on an Ethernet network (such as a PC, workstation, or printer) has its own network interface
card (NIC). The NIC fits inside the station and provides the station with a 6- byte physical address (MAC/Ethernet
address).

The Ethernet address is 6 bytes (48 bits), normally written in hexadecimal notation, with a colon between
the bytes.

Unicast, Multicast, and Broadcast Addresses

 A source address is always a unicast address--the frame comes from only one station.
 The destination address, can be unicast, multicast, or broadcast
o If the least significant bit of the first byte in a destination address is 0, the address is unicast;
otherwise, it is multicast.

A unicast destination address defines only one recipient Relationship : one to one
A multicast destination address defines a group of addresses Relationship : one to many
Relationship : one to many
The broadcast address is a special case of multicast address; the
A broadcast destination address
recipients are all the stations on the LAN
is forty-eight l’s.

Transmission of Address Bits

The transmission is left to right, byte by byte; however, for each byte, the least significant bit is sent first and
the most significant bit is sent last.

This means that the bit that defines an address as unicast or multicast arrives first at the receiver. This
helps the receiver to immediately know if the packet is unicast or multicast.

Example
Qus : Define the type of the following destination addresses:
a. 4A:30:10:21:10:1A
b. 47:20:IB:2E:08:EE
c. FF:FF:FF:FF:FF:FF
Solution
To find the type of the address, we need to look at the second hexadecimal digit from the left. If it is even, the
address is unicast. If it is odd, the address is multicast. If all digits are Fs, the address is broadcast. Therefore, we
have the following:
a. This is a unicast address because A in binary is 1010 (even).

Page 61
COMPUTER NETWORKS CS 306

b. This is a multicast address because 7 in binary is 0111 (odd).


c. This is a broadcast address because all digits are Fs in hexadecimal

Example
Qus : Show how the address 47:20:1B:2E:08:EE is sent out on line.

Solution
The address is sent left-to-right, byte by byte; for each byte, it is sent right-to-left( LSB first), bit by bit, as shown
below:
Address: left-to-right : EE→08→2E→1B→20→ 47
47 is 0100 0111  right -to-left  1110 0010

Access Method:

CSMA/CD Standard Ethernet uses 1-persistent CSMA/CD

Slot Time: In an Ethernet network, the round-trip time required for a frame to travel from one end of a maximum-
length network to the other plus the time needed to send the jam sequence is called the slot time.

Slot time = round-trip time + time required to send the jam sequence

The slot time in Ethernet is defined in bits. It is the time required for a station to send 512 bits. This means
that the actual slot time depends on the data rate; for traditional 10-Mbps Ethernet it is 51.2µs.

Categories of Standard Ethernet

The Standard Ethernet defines several physical layer implementation, four of the most common:

Limitation of 10Base5 and 10Base2 is that communication is half-duplex.

10 Base 5:Thick Ethernet (Thicknet)

Page 62
COMPUTER NETWORKS CS 306

 Uses coaxial cable and Bus topology


 With an external transceiver ( transmitter/receiver) connected via a tap.
 Transceiver is responsible for:
 transmitting, receiving and
 detecting collisions.
 The length of each segment cannot exceed 500 m
 If cable > 500 m ,degradation in the signal, using repeaters to connect multiple “segments” of
cable.
 No two stations can be separated by more than 2500m ( max length of the bus) and 4 repeaters.

10Base2:Thin Ethernet (Cheapernet)

 Uses Bus topology with thinner and


more flexible cables.
 Transceiver part of a NIC card
 The implementation is more cost effective than 10Base5 because:
 Thin coaxial cable is less expensive than the thick
 tee connections are cheaper than taps
 Installation is simpler because thin coaxial cable is very flexible.
 The length of each segment under 200 (cannot exceed 185 m) due to the high level of attenuation
 Repeaters are used to connect multiple segments.

10 Base -T: Twisted-Pair Ethernet

 Physical star topology


 Stations are connected to a hub via two pairs of twisted cable ( one for sending and one for receiving|).
 Any collisions can happen in the hub

Page 63
COMPUTER NETWORKS CS 306

 Compared to others, the hub replaces the coaxial cable as far as a collision is concerned.
 Max length = 100 m to minimize attenuation.

10Base-F: Fiber Ethernet

 Uses star topology to connect stations to a hub


 Stations is connected to the hub by using two pairs of fiber-optic cables.

Encoding in a Standard Ethernet implementation

All standard implementations use digital signaling( baseband) at 10 Mbps.


At the sender, data are converted to a digital signal using the Manchester scheme.
At the receiver, the received signal is interpreted as Manchester and decoded into data.

Ethernet has the following advantages:

CHANGES IN THE STANDARD

The 10-Mbps Standard Ethernet has gone through several changes before moving to the higher data rates.
These changes actually opened the road to the evolution of the Ethernet to become compatible with other high-
data-rate LANs.

Page 64
COMPUTER NETWORKS CS 306

 Bridged Ethernet
 Switched Ethernet
 Full-Duplex Ethernet

Bridged Ethernet

Bridges have two effects on an Ethernet LAN:


 They raise the bandwidth and
 They separate collision domains.

In an unbridged Ethernet network, the total capacity (10 Mbps) is shared among all stations with a frame to
send; the stations share the bandwidth of the network.
A bridge divides the network into two or more networks. Bandwidth-wise, each network is independent.

A network with 12 stations is divided


into two networks, each with 6
stations.

Now each network has a capacity of


10 Mbps.

The 10-Mbps capacity in each


segment is now shared between 6
stations
Another advantage of a bridge is the separation of the collision domain.
- the collision domain becomes much smaller and the probability
of collision is reduced tremendously.

Switched Ethernet

Basic idea: improve on the Hub concept


• The switch learns destination locations by remembering the ports of the associated source address in a
table.
• The switch may not have to broadcast to all output ports. It may be able to send the frame only to the
destination port.
• Another advantage over a hub is if more than one frame transfer can go through the switch concurrently.

Under this scheme collisions are


still possible when two concurrently
arriving frames are destined for the same
station.

Each parallel transmission can take place


at 10Mbps

Page 65
COMPUTER NETWORKS CS 306

Full-Duplex Ethernet

The full-duplex mode increases the capacity of each domain from 10 to 20 Mbps. In full-duplex switched
Ethernet, there is no need for the CSMA/CD method. In a full duplex switched Ethernet, each station is connected to
the switch via two separate links.
The figure below shows a switched Ethernet
in full-duplex mode.
Note that instead of using one link between
the station and the switch, the configuration uses two
links: one to transmit and one to receive.
Each link is a point-to-point dedicated path
between the station and the switch. There is no
longer a need for carrier sensing; there is no longer a
need for collision detection.

Four data rates are currently defined for operation over optical fiber and twisted-pair cables :

• 10 Mbps - 10Base-T Ethernet (IEEE 802.3)


• 100 Mbps - Fast Ethernet (IEEE 802.3u)
• 1000 Mbps - Gigabit Ethernet (IEEE 802.3z)
• 10-Gigabit - 10 Gbps Ethernet (IEEE 802.3ae).

Fast Ethernet

Fast Ethernet was designed to compete with LAN protocols such as FDDI or Fiber Channel IEEE created Fast
Ethernet under the name 802.3u. Fast Ethernet is backward-compatible with Standard Ethernet, but it can transmit
data 10 times faster at a rate of 100 Mbps.

The goals of Fast Ethernet can be summarized as follows:


1. Upgrade the data rate to 100 Mbps.
2. Make it compatible with Standard Ethernet.
3. Keep the same 48-bit address.
4. Keep the same frame format.
5. Keep the same minimum and maximum frame lengths.

Fast Ethernet is designed to connect two or more stations together. If there are only two stations, they can
be connected point-to-point. Three or more stations need to be connected in a star topology with a hub or a switch
at the center.
Star topology have two choices :
 Half-duplex approach:
- The stations are connected via a hub.
- The access method is CSMA/CD
 Full-duplex approach.(Fast )
- The connection is made via a switch
with buffers at each port.
- No need for CSMA/CD
Page 66
COMPUTER NETWORKS CS 306

Encoding:
Manchester encoding needs a 200-Mbaud
bandwidth for a data rate of 100 Mbps.
(unsuitable for a medium such as Twisted Pair
cable).

In Fast Ethernet , three different encoding


schemes were used for each implementation.

Gigabit Ethernet

The need for an even higher data rate resulted in the design of the Gigabit Ethernet protocol (1000 Mbps).
The IEEE committee calls the Standard 802.3z.

The goals of the Gigabit Ethernet design can be summarized as follows:


1. Upgrade the data rate to 1 Gbps.
2. Make it compatible with Standard or Fast Ethernet.
3. Use the same 48-bit address.
4. Use the same frame format.
5. Keep the same minimum and maximum frame lengths.
6. To support auto negotiation as defined in Fast Ethernet.

Gigabit Ethernet is designed to connect two or more stations. If there are only two stations, they can be
connected point-to-point. Three or more stations need to be connected in a star topology with a hub or a switch at
the center.
Gigabit Ethernet can be used in half-duplex mode or full duplex mode.

 In half-duplex mode, uses hub and CSMA/CD.

 In the full-duplex mode, there is a central switch connected to all computers or other switches. Each
switch has buffers for each input port in which data are stored until they are transmitted. There is
no collision; the maximum length of the cable is determined by the signal attenuation in the cable.

Page 67
COMPUTER NETWORKS CS 306

Ten-Gigabit Ethernet

The IEEE committee created Ten-Gigabit Ethernet and called it Standard 802.3ae.

The goals of the Ten-Gigabit Ethernet design can be summarized as follows:

1. Upgrade the data rate to 10 Gbps.


2. Make it compatible with Standard, Fast, and Gigabit Ethernet.
3. Use the same 48-bit address.
4. Use the same frame format.
5. Keep the same minimum and maximum frame lengths.
6. Allow the interconnection of existing LANs into a metropolitan area network (MAN) or a wide area
network (WAN).
7. Make Ethernet compatible with technologies such as Frame Relay and ATM.

Ten-Gigabit Ethernet operates only in full duplex mode which means there is no need for contention;
CSMA/CD is not used in Ten-Gigabit Ethernet.

The physical layer in Ten-Gigabit Ethernet is designed for using fiber-optic cable over long distances. Three
implementations are the most common:
 10GBase-S
 10GBase-L
 10GBaseE

IEEE 802.4 (Token Bus)

Page 68
COMPUTER NETWORKS CS 306

Page 69
COMPUTER NETWORKS CS 306

IEEE 802.5 [TOKEN RING]

Each station is connected to the ring through a Ring


Interface Unit (RIU).The sequene of token is
determined by the physical locations of stations on
the ring.

IEEE 802.5 Frame format

Page 70
COMPUTER NETWORKS CS 306

Qus : Compare 802.3, 802.4 and 802.5.

IEEE 802.3 IEEE 802.4 IEEE 802.5


Uses 1-persistent CSMA/CD Uses Token Bus medium Uses Token Ring medium access
medium access protocol access protocol protocol
The stations are logically The stations are logically The Stations are physically
connected to each other via connected to each other via connected to each other via point-
a broadcast cable medium a broadcast cable medium. to-point links
Frames are transmitted to the
Frames are broadcasted to Frames are broadcasted to
destination using point-to-point
the destination the destination
links.
Transmission medium used is
Transmission media used is Transmission media used is
generally coaxial cable or
generally coaxial cable, generally coaxial cable, optical
twisted pair. It is not well
optical fiber or twisted pair fiber or twisted pair
suited to fiber cables
There is no prioritization of
Stations are prioritized for Stations are prioritized for
stations for transmission of
transmission of data transmission of data
data.
It cannot transmit short It can handle transmission of It can handle transmission of
frames. short frames. short frames.

Page 71
COMPUTER NETWORKS CS 306

It cannot be used for real It is used for real time


It is used for office automation
time applications. applications.
It applies Manchester It applies differential Manchester
It applies Analog Encoding
Encoding Encoding
At high loads, its efficiency is At high loads, its efficiency is At high loads, its efficiency is also
very low. However, at low very high. However, at low high and at low loads, its
loads, its efficiency is high loads, its efficiency is low efficiency is low similar to the
due to less delay due to more delay Token Bus
No Priorities It support priorities Priorities are possible

Qus: State which layers of the OSI model does the following interconnecting devices operate
a) Repeaters
b) Bridges
c) Routers
d) Gateways.

Answers:
a) Repeaters
 A repeater connects different segments of a LAN.
 A repeater forwards every frame it receives.
 Repeaters operate at the physical layer of the OSI model.
 It simply repeats, retimes and amplifies the bits it receives.

b) Bridges
 Bridges can be used to connect networks with different types of cabling or physical topologies but
with same communication protocol.
 A bridge can divide a large network into two or more smaller and efficient networks.
 Bridges learn which workstations are on what network segment by looking at the hardware address
in the frames it receives and entering this information into a table.
 If the recipient’s MAC address is not in the list, the bridge then does a flood; it sends the signal to
all the ports except the one from where it was received.
 It inspects incoming traffic and decides whether to forward or discard it.
 A bridge operates both in physical and data-link layer
 Types of bridges:
 Transparent Bridges
 Source routing bridges

c) Routers

Page 72
COMPUTER NETWORKS CS 306

 Routers operate at the network level of the OSI model.


 Routers are devices which connect two are more networks that use similar
protocol.
 A router creates and/or maintains a table, called a routing table that stores the best
routes to certain network destinations
 Routers are generally expensive and difficult to configure and maintain.
 Routes packets based on their logical addresses.

d) Gateways
 Gateways are multi-purpose connection devices.

 Joins networks operating on different protocols together. Hence


it is also known as protocol converter.
 A gateway works above the network layer.

Qus : What is the use of bridge? Explain the types of bridges.

The uses of bridge are


o Frame filtering and forwarding
o Learning the address
o Routing

There are 2 types of bridge


1. Transparent bridge
2. Source Routing Bridge

Transparent bridge

- Transparent bridge keeps a suitable of addresses in memory to determine where to send data

Source Routing Bridge

- Source Routing Bridge requires the entire routing table to be included in the transmission and do
not route packet intelligently.

Qus: Explain hidden and exposed terminal problems.


There are three problems in a wireless LAN, which are not found in wired LANs. These problems are as
follows: -
Hidden terminal problem
Exposed terminal problem
Inability to detect collision

Hidden terminal problem

A, C want to send to B
Page 73
COMPUTER NETWORKS CS 306

A starts transmitting, C cannot hear (out of range)


C then transmits, interferes with B

Exposed terminal problem

A wants to transmit to B, C wants to transmit to D


Note: both transmissions can happen simultaneously since there will be bad reception only in area between
B and C
A transmits, C senses channel and falsely thinks it can’t transmit, doesn’t transmit

MACA protocol solved hidden, exposed terminal:

-- Send Ready-to-Send (RTS) and Clear-to-Send (CTS) first


-- RTS, CTS helps determine who else is in range or busy (Collision avoidance).

* MACA avoids the problem of hidden terminals


* A and C want to send to B
* A sends RTS first
* C waits after receiving CTS from B

* MACA avoids the problem of exposed terminals


* B wants to send to A, C to another terminal
* now C does not have to wait for it cannot
receive CTS from A
*
IEEE 802.11 (Wireless LAN)

IEEE has defined the specifications for a wireless LAN, called IEEE 802.11, which covers the physical
and data link layers. A wireless LAN uses wireless transmission medium.

802.11 transmissions are complicated by wireless conditions that vary with even small changes in
the environment. At the frequencies used for 802.11, radio signals can be reflected off solid objects so
that multiple echoes of a transmission may reach a receiver along different paths. The echoes can cancel
or reinforce each other, causing the received signal to fluctuate greatly. This phenomenon is called
multipath fading.

The key idea for overcoming variable wireless conditions is path diversity, or the sending of
information along multiple, independent paths.

Wireless LANs provide


 Flexibility
 Portability
 Mobility
 Ease of Installation

Page 74

Вам также может понравиться