Professional Documents
Culture Documents
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
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
Router
Switch
Wireless Network
Network Topologies
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
Simplex
Half–duplex
Full-duplex
Simplex
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.
Application Application
Layer 7
Presentation Presentation
Layer 6
Session Session
Layer 5
Transport Transport
Layer 4
Network Network
Layer 3
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
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
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
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
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
11.7
Bit stuffing and unstuffing
11.8
11.9
Error Detecting Codes
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
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
11.31
Figure 11.9 Flow diagram for Example 11.2
11.32
11-5 NOISY CHANNELS
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
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
12.83
Note
12.84
Flow diagram for CSMA/CA
12.85