You are on page 1of 148

Computer Networks

Unit-I
Unit 1 Introduction to Computer Networking, Network
Topologies, Types of area networks – LAN, MAN and
WAN, Transmission Modes in Computer Networks
(Simplex, Half-Duplex and Full-Duplex), Layers of OSI
Model, TCP/IP Model,Network Devices (Hub, Repeater,
Bridge, Switch, Router), IEEE 802.3;
ETHERNET, Fast ETHERNET, Gigabit ETHERNET

Text Books:
[T1] Andrew S. Tanenbaum, David J Wetherall, “Computer
Networks”, Pearson
Education.
[T2] Alberto Leon Garcia and Indra Widjaja, “Communication
Networks:
Fundamental Concepts and Key Architectures”, Tata McGraw
Hill
[T3] James Kurose, Keith Ross, “Computer Networks: A Top -
Down Approach”,
Pearson Education.
Reference Books:
[R1] Larry L Peterson, Bruce S Davis, “Computer Networks”,
Introduction

 A computer network is a group of computers/devices(Nodes) that use a set


of common communication protocols over digital interconnections for the
purpose of sharing resources located on or provided by the network nodes.
 The nodes of a computer network may include personal computers, servers,
networking hardware, or other specialised or general-purpose hosts.
 The interconnections between nodes are formed from a broad spectrum of
telecommunication network technologies, based on physically wired, optical,
and wireless technologies.
 A communication protocol is a set of rules for exchanging information over a
network. physically
Components of a Computer Network

 Hosts/Nodes
 Servers
 Client
 Network hardware(NIC,Router,Switch ,Hub)
 Communication channel
 Software(such as protocol,network operating system etc)
 Network Services
Wired Network PC Firewall The Internet

Fiber Optic Network Cable

Router
Switch

Server Other LANS

Wireless Network
Network Topologies

 Network topology defines the structure of the network.


A. Physical topology:- It define the actual layout of the wire or media.
1. Bus
2. Ring
3. Star
4. Tree(Hierarchical)
5. Mesh
Bus Topology
All devices are connected to a central
cable, called bus or backbone. T T
There are terminators at each end of
the bus that stops the signal and
keeps it from traveling backwards.

Advantages: Disadvantages:
1. There is no central controller. 1. It is possible that more than one station may
attempt transmission simultaneously (collision or
2. Control resides in each station
contention).
3. The less interconnecting wire is
2. Difficult reconfiguration and fault isolation.
required.
3. A fault or break in the bus cable stops all
4. Ease of installation.
transmission, even between devices on the same
5. Backbone cable can be laid along the side of the problem.
most efficient path, and then
4. The damaged area reflects signals in the direction
connected to the nodes by drop lines
of origin, creating noise in both directions
of various lengths
Ring Topology
• All devices are connected to one another in the shape
of a closed loop.
• Each device is connected directly to two other devices,
one on either side of it.
•Data is accepted from one of the neighbouring nodes and is
transmitted to another
Advantages:
1. Avoids the collisions that are possible in the bus topology.
2. Each pair of stations has a point-to-point connection.
3. A signal is passed along the ring in one direction, from device to
another, until it reaches its destination.
4. Each device incorporates a repeater.
5. Relatively easy to install and reconfigure.
6. Fault isolation is simplified.

Disadvantages:
1. A break in the ring (such as station disabled) can disable the entire
Star Topology
• All devices are connected to a central hub.
• Nodes communicate across the network by passing data
through the hub or switch.
Advantages:
1. Easy to install and reconfigure.
2. Robustness, if one link fails; only that link is affected. All other
links remain active.
3. Easy fault identification and isolation. As long as the hub is
working, it can be used to monitor link problems and bypass
defective links.
Disadvantages:
1. The devices are not linked to each other.
2. If one device wants to send data to another, it sends it to the
controller, which then relays the data to the other connected device.
Tree Topology
Advantages:
1. It allows more devices to be attached to a
single central hub and can therefore increase
the distance a signal can travel between
devices.
2. It allows the network to isolate and prioritize
communications from different computers.

Disadvantages:
1. The devices are not linked to each other.
2. If one device wants to send data to another,
it sends it to the controller, which then relays
the data to the other connected device.
3. The addition of secondary hubs brings two
further advantages.
Mesh Topology
Each host has its connections to all other hosts.
Mesh topology is implemented to provide as much
protection as possible from interruption of service.
1. A nuclear power plant might use a mesh
topology in the networked control systems.
2. Although the Internet has multiple paths to any
one location, it does not adopt the full mesh
topology.
Advantages: Disadvantages:
1. The use of dedicated links guarantees that each 1. A large amount of cabling required.
connection can carry its data load, thus eliminating 2. A large amount of I/O ports required.
the traffic problems that can occur when links must 3. Installation and reconfiguration are difficult.
be shared by multiple devices. 4. The sheer bulk of the wiring can be greater
2. It is robust, if one link becomes unusable, it does than the available space (in the walls, ceiling,
not incapacitate (affect) the entire system. or floors) can accommodate.
3. Privacy and Security (every message sent travels 5. The hardware required to connect each
along a dedicated line; only the intended recipient link (I/O ports and cables) can be
sees it). prohibitively expensive.
4. Point-to-point links make fault identification and
fault isolation easy.
Types of Area Network

 LAN-Local Area Network


 MAN-Metropolitan Area Network
 WAN-Wide Area Network
LAN
 Xerox Corporation worked in collaboration with DEC and Intel to create
Ethernet, which is the most pervasive LAN architecture used today.
 Ethernet has evolved and has seen significant improvements in regard to speed
and efficiency.
 An upside of a LAN is fast data transfer with data speed that can reach up to
10Gbps.
 Other significant LAN technologies are Fiber Distributed Data Interface (FDDI)
and token ring.
MAN
1. A MAN is larger than a LAN but smaller than or equal in size to a WAN.
2. The size range anywhere from 5 to 50km in diameter.
3. MANs are typically owned and managed by a single entity.
4. This could be an ISP or telecommunications company that sells its services to
end-users in that metropolitan area.
5. For all intents and purposes, a MAN has the same characteristics as a WAN
with distance constraints.
WAN

• A Wide Area Network exist over a large area


• Data travels through telephone or cable lines
• Usually requires a Modem
• The world’s largest Wide Area Network in the Internet
Transmission Modes

 Simplex
 Half–duplex
 Full-duplex
Simplex

 In Simplex mode, the communication is unidirectional, as on a one-way


street.
 Only one of the two devices on a link can transmit, the other can only
receive.
 The simplex mode can use the entire capacity of the channel to send data in
one direction.
 Example: Keyboard and traditional monitors. The keyboard can only introduce
input, the monitor can only give the output.
Channel capacity=Bandwidth * Propagation Delay
Channel capacity=Bandwidth * Propagation Delay

Half-Duplex
 In half-duplex mode, each station can both transmit and receive, but not at
the same time.
 When one device is sending, the other can only receive, and vice versa.
 The half-duplex mode is used in cases where there is no need for
communication in both directions at the same time.
 The entire capacity of the channel can be utilized for each direction.
 Example: Walkie-talkie in which message is sent one at a time and messages
are sent in both directions.
Full-Duplex
 In full-duplex mode, both stations can transmit and receive simultaneously.
 In full duplex mode, signals going in one direction share the capacity of the link
with signals going in another direction, this sharing can occur in two ways:
 Either the link must contain two physically separate transmission paths, one for sending
and the other for receiving.
 Or the capacity is divided between signals traveling in both directions.

 Full-duplex mode is used when communication in both directions is required all


the time. The capacity of the channel, however, must be divided between the two
directions.
 Example: Telephone Network in which there is communication between two
persons by a telephone line, through which both can talk and listen at the same
time.
Review Questions
 Three or more devices share a link in c) Full-duplex
________ connection. d) Simplex
a) Unipoint
 In computer network nodes are
b) Multipoint
_________
c) Point to point
a) the computer that originates the data
d) Simple
b) the computer that routes the data
 A _________ set of rules that governs c) the computer that terminates the data
data communication. d) all of the mentioned
a) Protocols
 Bluetooth is an example of __________
b) Standards
a) personal area network
c) RFCs
b) local area network
d) Servers
c) virtual private network
 The first Network was called ________ d) wide area network
a) CNNET
 Communication channel is shared by all
b) NSFNET
the machines on the network in ________
c) ASAPNET
a) broadcast network
d) ARPANET
b) unicast network
 Communication between a computer and c) multicast network
a keyboard involves ______________ d) anycast network
transmission.
a) Automatic
b) Half-duplex
Basic concepts of Protocol layering
 To make the design process easy by breaking unmanageable tasks into several
smaller and manageable tasks (by divide-and-conquer approach).
 Each layer can be analyzed and tested independently of all other layers.
 Each layer adds to the service provided by the lower layers in such a manner
that the highest layer is provided a full set of services to manage
communication and run the applications
 Single layered Protocol
 Multiple layered protocol
Multiple layered protocol
Principles of Protocol layering
 Bidirectional communication:we need to make each layer so that it is able to
perform two opposite tasks one in each direction
 Two object under each layer should be Identical
Open System Interconnection Reference
Model(OSI Model)
OSI Model
Device A Device B

User Program User Program

Application Application
Layer 7

Presentation Presentation
Layer 6

Session Session
Layer 5

Transport Transport
Layer 4

Network Network
Layer 3

Data Link Data Link


Layer 2

Physical Physical
Layer 1

medium
1. PHYSICAL LAYER
 Physical layer in the OSI model is the lowest layer of the OSI reference model.
 It is responsible for sending raw bits from one computer to another computer over a
network.
 defines the relationship between a device and a transmission medium, such as a copper
or optical cable.
 It plays the role of interacting with actual hardware and signaling mechanisms.
2. DATA LINK LAYER
 This layer takes the data frames or messages from the Network Layer and provides for
their actual transmission flow control
 At the receiving computer, this layer receives the incoming data and sends it to the
network layer for handling
 It does this by packaging the data from the Network Layer into a frame, which includes error
detection information
 At the receiving computer, the Data-Link Layer reads the incoming frame, and
generates its own error detection information based on the received frames data. After
receiving the entire frame, it then compares its error detection value with that of the
incoming frames, and if they match, the frame has been received correctly.
 Hop to Hop Delivery
 Error Control
 Flow control
.
3.Network layer
 to provide an end-to-end communication capability in contrast to
machine-to-machine communication provided by the data link layer.
This end-to-end is performed using two basic approaches known as
connection oriented or connectionless network-layer servicesprovides
the transparent transfer of data between transport entities.
 Responsible for establishing, maintaining, and terminating connections
(between networks). Use globally unique node address.
 This is responsible for addressing messages and data so they are sent to
the correct destination, and for translating logical addresses and names
(like a machine name FLAME) into physical addresses. This layer is also
responsible for finding a path through the network to the destination
computer
4.TRANSPORT LAYER
 Ensures that data units are delivered error-free, in sequence, without no
losses or duplications.
 This layer also repackages data by assembling long messages into lots of
smaller messages for sending and repackaging the smaller messages into the
original larger messages at the receiving end
5.Session layer
 Session Establishment: The session layer's main function is to establish a
connection between the session users, known as a session. It can select a session
between two computers for communication, file transfer, remote login or other
purposes.
 Normal Data Transfer: It is an essential function of the session layer. The data
network between the customer entities may either be a two-way alternate (half-
duplex) or two way concurrent (full-duplex).
 Dialogue Management: In this term, the session relationship is full-duplex, but the
upper layer sometimes communicates in half-duplex nodes. In such methods, the
session layer has to manage the track of those to speak and is referred to as the
dialogue management.
 Session Release: For releasing the session connection, one of the following four
variations are used, which are namely, User abort, Provider abort, Orderly release,
Negotiated Release.
 Synchronization: The session layer enables a phase to insert checkpoint, i.e.,
synchronization points, into a data stream. If a crash occurs during the data
transmission, it can be retransmitted from the checkpoint despite retransmitting it
from the start.
6.Presentation layer

 This layer is concerned with Syntax and Semantics of the information


transmitted, unlike other layers, which are interested in moving data reliably
from one machine to other.
 Few of the services that Presentation layer provides are:
 1. Encoding data in a standard agreed upon way.
 2. It manages the abstract data structures and converts from representation
used inside computer to network standard representation and back
7. APPLICATION LAYER The application layer consists of what most users think of
as programs .
File transfer (FTP): Connect to a remote machine and send or fetch an arbitrary
file. FTP deals with authentication, listing a directory contents, ASCII or binary
files, etc.
• Remote login (telnet): A remote terminal protocol that allows a user at one
site to establish a TCP connection to another site, and then pass keystrokes from
the local host to the remote host.
• Mail (SMTP): Allow a mail delivery agent on a local machine to connect to a
mail delivery agent on a remote machine and deliver mail.
• News (NNTP): Allows communication between a news server and a news client.
• Web (HTTP): Base protocol for communication on the World Wide Web.
Summary of layers(OSI)
Review questions
 Which layer helps to understand data representation in one form on a host to other
host in their native representation?
A. Application Layer
B. Presentation Layer
C. Session Layer
D. Transport Layer
 HTTP is an example of?
A. Session Layer
B. Presentation Layer
C. Data Link Layer
D. Application Layer
 Which layer helps to uniquely identify hosts beyond the subnets and defines the path
which the packets will follow or be routed to reach the destination?
A. Physical Layer
B. Data Link Layer
C. Network Layer
D. Transport Layer
 Bits can be send over guided and unguided media as analog signal by
A. digital modulation
B. amplitude modulation
C. frequency modulation
Review Questions
 The network layer is responsible for carrying data from one host to another.
A. TRUE
B. FALSE
C. Can be true or false
D. Can not say

(Transmission control Protocol/Internet
protocol :TCP/IP Protocol)
Data flow in four layer model
 Refers to Family of protocol
 The protocols are built on top of connectionless technology
 Data sent from one node to another as a sequence of datagrams
 Each datagram sent independently
 Datagrams corresponding to the same message may follow different routes
may possible variable delay and arrival order at the destination.
TCP/IP family Member
Function of IP
 IP transports datagrams(packets) from the source node to the destination node
 Responsible for routing the packet
 Breaks the packet into smaller packets if required
 Unreliable services
A packet may be lost
A packet may arrive out of order
Duplicate packets may be generated
Fuction of TCP
 TCP provides a connection oriented reliable service for sending messages
 Split Messages into packets
 Reassemble packets at destination
 Resend packets that were lost in transit

 Interface with IP
 Each packet forwarded to IP for delivery
 Error Control is done by TCP
Function of UDP
 UDP provides a connectionless unreliable service for sending
datagrams(packets)
 Message small enough to fit in a packet(e.g DNS (domain name Query)
 Simpler and faster than TCP
 Never splits data into multiple packets
 Does not care about error control
 Interface with IP
 Each UDP packet forward it to IP
Addresses in TCP/IP
Network Devices

 Hub
 Repeater
 Bridge
 Switch
 Router
Hubs
 Hubs is a networking device having multiple ports
that are used for connecting multiple computers
or segments of a LAN together.
 Hubs can be either passive or Active
 Active hubs electrically amplify the signals as it
moves from one connected device to other
 Passive hubs allow the signal to pass from one
computer to another without any change.
 Hubs does not remember devices/computers
connected to it,hence broadcast all information
to all connected computers,including the one that
sent it
 A hub can send or receive information but it cant
do both at a time
Repeater

 A repeater is a network device used to regenerate a


signal.
 Repeaters regenerate analog or digital signals that
are distorted by transmission loss due to
attenuation.
 A repeater does not make an intelligent decision
concerning forwarding packets
Bridge

 Bridges convert network data formats


and perform basic data transmission
management.
 Bridges provide connections between
LANs.
 They also check data to determine if it
should cross the bridge. This makes each
part of the network more efficient
Switch

 Switches add more intelligence to data transfer management.


 They can determine if data should remain on a LAN and transfer data only
to the connection that needs it.
Difference between Hub and Switch

Hub Switch
Repeats the incoming traffic to all Sends traffic only to appropriate
connections connections
Offers Single lane connection,hence Establish two lane
either send or receive at a time connection,Facilitating send and
receives at the same time
Shares Bandwidth among its Does Not share bandwidth,Each
Connections connection gets full bandwidth

Inexpensive Choice Expensive choice


Review Questions
Router

 Router is a network device that forward data from one network to another.
 Routers can regenerate signals, concentrate multiple connections, convert
data transmission formats, and manage data transfers.
 They can also connect to a WAN, which allows them to connect LANs that are
separated by great distances.
IEEE 802.3

 IEEE 802.3 is a set of standards and protocols that define Ethernet-based


networks.
 Ethernet technologies are primarily used in LANs, though they can also be
used in MANs and even WANs.
 IEEE 802.3 defines the physical layer and the medium access control (MAC)
sub-layer of the data link layer for wired Ethernet networks.
 Frame Format of IEEE 802.3
 The main fields of a frame of classic Ethernet are -
 Preamble: It is a 7 bytes starting field that provides alert and timing pulse for transmission.
 Start of Frame Delimiter: It is a 1 byte field that contains an alternating pattern of ones and
zeros ending with two ones.
 Destination Address: It is a 6 byte field containing physical address of destination stations.
 Source Address: It is a 6 byte field containing the physical address of the sending station.
 Length: It a 7 bytes field that stores the number of bytes in the data field.
 Data: This is a variable sized field carries the data from the upper layers. The maximum size of
data field is 1500 bytes.
 Padding: This is added to the data to bring its length to the minimum requirement of 46 bytes.
 CRC: CRC stands for cyclic redundancy check. It contains the error detection information.
ETHERNET
 The original Ethernet was created in 1976 at Xerox’s Palo Alto Research Center
(PARC).
 Normal ethernet works at 10Mbps speed. The Ethernet MAC technology is
called CSMA/CD (carrier-sense multiple access with collision detection).
 Following table mentions different 10 Mbps Ethernet such as 10BASE5,
10BASE2, 10BASE-F and 10BASE-T.
 There are two types of Ethernet: half duplex and full duplex.
 Following are the Ethernet MAC parameters:
Slot time: 512 bit times
Min. Interframe Gap: 96 bit times
Attempt Limit: 16 (tries)
Backoff limit: 10 (exponential number)
JamSize: 32 bits
Max. Frame Size: 1518 bytes
Min. Frame Size: 64 bytes (512 bits)
Address Size: 48 bits
Fast ETHERNET
 The ethernet working at the speed of 100Mbps is referred as fast ethernet.
IEEE standard 802.3u fast ethernet/100BASE-T specified in May1995. The
features of this type of fast ethernet are as follows:
• Includes multiple PHY layers.
• It uses original ethernet MAC but operates at 10 times higher speed.
• It needs star wired configuration with central hub.

 The MAC parameters are same as described for ethernet above. There are
three physical layers for fast ethernet.
• 100BASE-TX: Needs 2 pairs of cat.5 UTP/Type1 STP cables
• 100BASE-FX: Needs 2 strands of multimode fiber
• 100BASE-T4: Needs 4 pairs of cat.3 or any better cables
Gigabit ETHERNET

 The ethernet working at the speed of 1000Mbps (i.e. 1Gbps) and above is
referred as Gigabit ethernet.
 Gigabit Ethernet uses 802.3 frame format same as 10Mbps ethernet and
100Mbps fast Ethernet It also operates in half duplex and full duplex modes.
There are various Gigabit ethernet versions which operates at 1 Gigabit, 10
Gigabit, 40 Gigabit and 100 Gigabit per second speeds.
 There are various versions for 10 Gbps ethernet such as 10GBASE-T, 10GBASE-
R, 10GBASE-X and 10GBASE-W.
 MAC parameters for gigabit ethernet are same as mentioned above in
ethernet. Except slot time which is 512 byte times.
Unit-II
Computer Network
Data Link layer Control
• Providing services to the network layer
1.Unacknowledged connectionless service(ETHERNET)
2.Acknowledged connectionless service(IEEE802.3 WIFI)
3.Acknowledged connection oriented service(Satellite or long
distance telephone circuit)
• Data link Control Includes: Framing
Flow and Error Control
Error Detection and Correction
• Regulating the flow of data so that slow receivers are not swamped by
fast senders
Framing
 Framing is a point-to-point connection between two devices that consists of a wire in which data is
transmitted as a stream of bits.
 Framing in a computer network uses frames to send/receive the data. The data link layer packs bits into
frames such that each frame is distinguishable from another.
 The data link layer prepares a packet for transport across local media by encapsulating it with a header
and a trailer to create a frame.
 The frame consists of the following parts:
 Frame Header: It consists of the frame's source and destination address.
 Payload Field: It contains the message to be delivered.
 Flag: It points to the starting and the ending of the frame.
 Trailer: It contains the error detection and correction bits.
Methods to breakup the bit stream into
frames
1. Byte Count
2.Flag Bytes with byte stuffing
Byte stuffing and unstuffing

11.6
Flag Bits with Bits stuffing

Bit stuffing is the process of adding one


extra 0 whenever five consecutive 1s
follow a 0 in the data, so that the
receiver does not mistake
the pattern 0111110 for a flag.

11.7
Bit stuffing and unstuffing

11.8
11.9
Error Detecting Codes

 Basic approach used for error detection is the use of


redundancy, where additional bits are added to
facilitate detection and correction of errors. Popular
techniques are:
 • Simple Parity check
 • Two-dimensional Parity check
 • Checksum
 • Cyclic redundancy check
11.10
Single Bit Parity Check
Performance of Simple Parity Check

 An observation of the table reveals that to move from one code word to
another, at least two data bits should be changed
 Hence these set of code words are said to have a minimum distance (hamming
distance) of 2, which means that a receiver that has knowledge of the code
word set can detect all single bit errors in each code word.
 However, if two errors occur in the code word, it becomes another valid
member of the set and the decoder will see only another valid code word and
know nothing of the error.
 Thus errors in more than one bit cannot be detected.
Two dimensional parity check
 Performance can be improved by using two-dimensional parity check, which
organizes the block of bits in the form of a table
 Parity check bits are calculated for each row, which is equivalent to a simple
parity check bit
 Parity check bits are also calculated for all columns then both are sent along
with the data
 At the receiving end these are compared with the parity bits calculated on
the received data
 Two- Dimension Parity Checking increases the likelihood of detecting burst
errors
 It significantly improves error detection capability compared to simple parity
check.
 It can detect many burst errors but not all.
 For example, if two data units: 11001100 and 10101100. If first and second
from last bits in each of them is changed, making the data units as 01001110
and 00101110, the error cannot be detected by 2-D Parity check.
Checksum
 Sender Side:In checksum error detection scheme, the data is divided into k
segments each of m bits
 In the sender’s end the segments are added using 1’s complement arithmetic
to get the sum.
 The sum is complemented to get the checksum
 The checksum segment is sent along with the data segments
 Receiver End:At the receiver’s end, all received segments are added using 1’s
complement arithmetic to get the sum
 The sum is complemented. If the result is zero, the received data is
accepted; otherwise discarded
Performance
 The checksum detects all errors involving an odd number of bits.
 It also detects most errors involving even number of bits
Cyclic Redundancy Check(CRC)
 Cyclic Redundancy Check is the most powerful and easy to implement
technique.
 Unlike checksum scheme, which is based on addition, CRC is based on binary
division.
 In CRC, a sequence of redundant bits, called cyclic redundancy check bits,
are appended to the end of data unit so that the resulting data unit becomes
exactly divisible by a second, predetermined binary number.
 At the destination, the incoming data unit is divided by the same number. If
at this step there is no remainder, the data unit is assumed to be correct and
is therefore accepted.
 A remainder indicates that the data unit has been damaged in transit and
therefore must be rejected
Cyclic Redundancy Check
Cyclic Redundancy Check(CRC)
Sender
Receiver
Error Correcting Codes

 Error Correction can be handled in two ways.


 One is when an error is discovered; the receiver can ask the sender to
retransmit the entire data unit. This is known as backward error correction.
 In the other, receiver can use an error-correcting code, which automatically
corrects certain errors. This is known as forward error correction
 Error-correcting codes are more sophisticated than error detecting codes and
require more redundant bits. The number of bits required to correct multiple-
bit or burst error is so high that in most of the cases it is inefficient to do so.
For this reason, most error correction is limited to one, two or at the most
three-bit errors.
11.27
NOISELESS CHANNELS

Let us first assume we have an ideal channel in which


no frames are lost, duplicated, or corrupted. We
introduce two protocols for this type of channel.

Simplest Protocol
Stop-and-Wait Protocol

11.28
Figure 11.7 shows an example of communication using
this protocol. It is very simple. The sender sends a
sequence of frames without even thinking about the
receiver. To send three frames, three events occur at the
sender site and three events at the receiver site.

11.29
Figure 11.7 Flow diagram for Example 11.1

11.30
Example 11.2

Figure 11.9 shows an example of communication using


this protocol. It is still very simple. The sender sends one
frame and waits for feedback from the receiver. When the
ACK arrives, the sender sends the next frame. Note that
sending two frames in the protocol involves the sender in
four events and the receiver in two events.

11.31
Figure 11.9 Flow diagram for Example 11.2

11.32
11-5 NOISY CHANNELS

Although the Stop-and-Wait Protocol gives us an idea of


how to add flow control to its predecessor, noiseless
channels are nonexistent. We discuss three protocols in
this section that use error control.

Topics discussed in this section:


Stop-and-Wait Automatic Repeat Request
Go-Back-N Automatic Repeat Request
Selective Repeat Automatic Repeat Request
11.33
Note

Error correction in Stop-and-Wait ARQ is


done by keeping a copy of the sent
frame and retransmitting of the frame
when the timer expires.

11.34
Figure 11.11 shows an example of Stop-and-Wait ARQ.
Frame 0 is sent and acknowledged. Frame 1 is lost and
resent after the time-out. The resent frame 1 is
acknowledged and the timer stops. Frame 0 is sent and
acknowledged, but the acknowledgment is lost. The
sender has no idea if the frame or the acknowledgment
is lost, so after the time-out, it resends frame 0, which is
acknowledged.

11.35
Figure 11.11 Flow diagram for Example 11.3

11.36
Multiple Access

12.56
Taxonomy of multiple-access protocols

12.59
Frames in a pure ALOHA network

12.62
Figure 12.5 Vulnerable time for pure ALOHA protocol

12.64
Example

A pure ALOHA network transmits 200-bit frames on a shared channel of 200 kbps.
What is the requirement to make this frame collision-free?

Solution
Average frame transmission time Tfr is 200 bits/200 kbps or 1 ms. The vulnerable
time is 2 × 1 ms = 2 ms. This means no station should send later than 1 ms before
this station starts transmission and no station should start sending during the one 1-
ms period that this station is sending.

12.65
The throughput for pure ALOHA is
S = G × e −2G
Where G is the Number of stations wish to
transmit at the same time .
The maximum throughput
Smax = 0.184 when G= (1/2).
12.66
Frames in a slotted ALOHA network
1) The time of the shared channel is divided into discrete time intervals called slots
2).Sending of the data is allowed only at the beginning of the slot

12.67
Note

The throughput for slotted ALOHA is


S = G × e−G .
The maximum throughput
Smax = 0.368 when G = 1.

12.68
Figure 12.7 Vulnerable time for slotted ALOHA protocol

12.69
CSMA(Sense Before transmit)
 The poor efficiency of the ALOHA scheme can be attributed to the fact that a
node start transmission without paying any attention to what others are doing
 In this scheme, a node having data to transmit first listens to the medium to
check whether another transmission is in progress or not.
 The node starts sending only when the channel is free, that is there is no
carrier. That is why the scheme is also known as listen-beforetalk. There are
three variations of this basic scheme as outlined below.
 (i) 1-persistent CSMA: In this case, a node having data to send, start sending, if
the channel is sensed free. If the medium is busy, the node continues to
monitor until the channel is idle. Then it starts sending data.
 (ii) Non-persistent CSMA: If the channel is sensed free, the node starts sending
the packet. Otherwise, the node waits for a random amount of time and then
monitors the channel.
 (iii) p-persistent CSMA: If the channel is free, a node starts sending the
packet. Otherwise the node continues to monitor until the channel is free and
then it sends with probability p.
Behavior of three persistence methods

12.71
Flow diagram for three persistence methods

12.72
CSMA/CD

 In CSMA scheme, when two packets collide the channel remains unutilized for the
entire duration of transmission time of both the packets. If the propagation time is
small (which is usually the case) compared to the packet transmission time,
wasted channel capacity can be considerable.
 This wastage of channel capacity can be reduced if the nodes continue to monitor
the channel while transmitting a packet and immediately cease transmission when
collision is detected. This refined scheme is known as Carrier Sensed Multiple
Access with Collision Detection (CSMA/CD) or Listen-While-Talk.
 On top of the CSMA, the following rules are added to convert it into CSMA/CD:
 (i) If a collision is detected during transmission of a packet, the node immediately
ceases transmission and it transmits jamming signal for a brief duration to ensure
that all stations know that collision has occurred.
 (ii) After transmitting the jamming signal, the node waits for a random amount of
time and then transmission is resumed.
Collision of the first bit in CSMA/CD

12.76
Figure 12.13 Collision and abortion in CSMA/CD

12.77
Example
A network using CSMA/CD has a bandwidth of 10 Mbps. If the maximum
propagation time (including the delays in the devices and ignoring the time
needed to send a jamming signal, as we see later) is 25.6 μs, what is the minimum
size of the frame?

Solution
The frame transmission time is Tfr = 2 × Tp = 51.2 μs. This means, in the worst
case, a station needs to transmit for a period of 51.2 μs to detect the collision.
The minimum size of the frame is 10 Mbps × 51.2 μs = 512 bits or 64 bytes. This is
actually the minimum size of the frame for Standard Ethernet.

12.78
Figure Flow diagram for the CSMA/CD

12.79
Figure Energy level during transmission, idleness, or collision

12.80
Timing in CSMA/CA

12.82
Note

In CSMA/CA, the IFS can also be used to


define the priority of a station or a frame.

12.83
Note

In CSMA/CA, if the station finds the


channel busy, it does not restart the timer of
the contention window;
it stops the timer and restarts it when the
channel becomes idle.

12.84
Flow diagram for CSMA/CA

12.85

You might also like