Computer Networks Notes (1)
Computer Networks Notes (1)
UNIT –II Data link layer: Introduction, Framing, and Error – Detection and Correction –
Parity – LRC CRC Hamming code, Flow and Error Control, Noiseless Channels, Noisy
Channels, HDLC, Point to Point Protocols. 111 Medium Access sub layer: ALOHA,
CSMA/CD, LAN Ethernet IEEE 802.3, IEEE 802.5 – IEEE 802.11, Random access,
Controlled access, Channelization.
UNIT – IV Transport Layer: Process to Process Delivery, UDP, TCP: TCP Segments, TCP
Connection, TCP sliding window, Data Traffic, Congestion, Congestion Control, QoS, QoS
in Switched Networks.
UNIT – V Application Layer: Domain name space, DNS in internet, electronic mail, SMTP,
FTP, WWW, HTTP, SNMP.
DATA:It is defined as an information in digital form that can be transmitted (or) processed, the data
may be in any format such as text, images, symbols, video & signals and so on…
COMMUNICATION: Communication is referred to as exchanging information from one entity to
another entity in a meaningful way.
DATA COMMUNICATION: From the above 2 references we understand that data communication is
a process of exchanging data between 2 devices through a communication medium in a meaningful
way.
UNIT – I
NETWORKS
A network is a set of devices (often referred to as nodes) connected by communication
links. A node can be a computer, printer, or any other device capable of sending and/or
receiving data generated by other nodes on the network.
Components of Computer Network
1. Server
A server is a computer that serves the data to other computers and users. The network
components can be in the form of a computer, a hardware device, or a computer program
that is loaded so that it can send data and any information to other computers.
The term “server” usually refers to a computer system that receives a request for a web
document and sends the request information to the client.
2. Client
The device that receives requests, and responses from the server, is called a client. When
the server and its clients work together on the computer, we call it the client/server
network.
3. Transmission media
Transmission media are the medium through which data is transferred from one device to
another in a network. Transmission media can be used either in a physical transmission
medium or wireless transmission medium.
Physical transmission medium includes the use of wires and cables like fiber optic cables,
coaxial cable, etc; and wireless transmission medium includes the use of unguided media like
infra-red waves, electromagnetic, microwaves, etc.
4. Hub
A hub is a device that splits a network connection among multiple computers. It works
similarly to a distribution center. When a computer requests information from one network or
from a specific computer, then it sends the request to the hub through a cable. The hub then
receives that request and transmits it to the entire network.
After that, every computer checks whether that network then belongs to them or not. If
belongs then it broadcasts if the request doesn’t belong it will be dropped.
However, such network components nowadays are very less in circulation and being replaced
by more advanced communication devices such as Routers and Switches. This hub is
basically a multiport repeater.
This hub is used to connect multiple connections that come from different branches, For
example, the connector in star topology is used to connect different stations for data access.
5. Switch
The switch is a component that helps devices to connect the networks so that they can
transfer data to other connected devices. These network switches are identical to network
hubs, but a switch has more advanced features than a hub. It doesn’t broadcast entire data on
the network like a hub.
The advanced features of the switch imply that the network switch first inspects the incoming
packet and determines its source, destination address, and routes after that sends the data at
the correct destination accordingly to that packet. A network switch is also called the
Switching hub, Bridging hub, and MAC bridge.
6. Router
The router is a hardware network component. Routers operate at the network layer of the OSI
(Open system interconnection) reference model, using them to send packets over the network
using a logical address.
Any data which travels from one network to another network as a Packet. The Router
receives such Packet data and forwards it to the Destination Device after analyzing hidden
information in the Data Packet. This Networking Device is used to connect different
networks either it is wired or wireless.
These networks are mainly seen in the house as Wi–Fi from which anyone can access the
Internet.
7. Repeater
A repeater is a powerful network component that is used to regenerate signals. With this, the
signal is fixed for a long time, so that the strength of the signal remains stable.
Repeater takes data signals from the communication medium and amplifies them and sends
them back to the communication medium. When the signal becomes weak, this device copies
the signal bit by bit and then regenerates it to its original strength for making the internet
connection stable.
A repeater is located in the first layer (physical layer) of the OSI layer. Repeaters are used in
cables that have to cover distances of up to 100 meters. These components receive signals
from cables like optical fibers, coaxial cables, and copper cables.
8. Bridges
This bridge is a device that has such functionality that it filters the content, for which it reads
MAC addresses of both source and destination. The bridge connects two LANs (Local Area
Network) using the same protocol. This device operates in the data link layer of the OSI
Model.
These network components are very useful for filtering the data load of traffic, for which they
divide them into segments or packets. The bridge controls the data traffic of LANs or other
networks. These bridges are actually passive devices, as there is no interaction between
bridged and paths of bridging.
9. Gateway
This gateway is a hardware device that acts as a “gate” within two networks. It can also be a
router, firewall, server, or any other device that enables traffic to flow in and out of the
network. Gateways are used to connect networks based on different protocols. As a bridge is
used to join two similar types of networks, similarly, the gateway is used to join two
dissimilar networks.
This gateway node is located at the edge of the network and all the data flows through it
which enters or exits the network. In addition, it can also translate received data that is
received from outside networks, into a format or protocol that can be identified by devices
within the internal network.
Types/Categories of Networks
Advantages of LAN
There are various advantages of LAN, which are as follows −
LAN software needed a memory area in each of the mainframe used on the
network. This decreases the memory space available for the user’s program.
Some security system should be executed if it is essential to protect private data.
Some control on the part of the customer is lost. We have to share a printer with different
customers.
Some current application programs will not run in a network environment.
MAN(Metropolitan Area Network)
o A metropolitan area network is a network that covers a larger geographic area by
interconnecting a different LAN to form a larger network.
o Government agencies use MAN to connect to the citizens and private industries.
o In MAN, various LANs are connected to each other through a telephone exchange line.
o The most widely used protocols in MAN are RS-232, Frame Relay, ATM, ISDN, OC-3,
ADSL, etc.
o It has a higher range than Local Area Network(LAN).
o Geographical area: A Wide Area Network provides a large geographical area. Suppose
if the branch of our office is in a different city then we can connect with them through
WAN. The internet provides a leased line through which we can connect with another
branch.
o Centralized data: In case of WAN network, data is centralized. Therefore, we do not
need to buy the emails, files or back up servers.
o Get updated files: Software companies work on the live server. Therefore, the
programmers get the updated files within seconds.
o Exchange messages: In a WAN network, messages are transmitted fast. The web
application like Facebook, Whatsapp, Skype allows you to communicate with friends.
o Sharing of software and resources: In WAN network, we can share the software and
other resources like a hard drive, RAM.
o Global business: We can do the business over the internet globally.
o High bandwidth: If we use the leased lines for our company then this gives the high
bandwidth. The high bandwidth increases the data transfer rate which in turn increases
the productivity of our company.
o Security issue: A WAN network has more security issues as compared to LAN and
MAN network as all the technologies are combined together that creates the security
problem.
o Needs Firewall & antivirus software: The data is transferred on the internet which
can be changed or hacked by the hackers, so the firewall needs to be used. Some
people can inject the virus in our system so antivirus is needed to protect from such a
virus.
o High Setup cost: An installation cost of the WAN network is high as it involves the
purchasing of routers, switches.
o Troubleshooting problems: It covers a large area so fixing the problem is difficult.
Types of Connections
There are 2 types of connections in computer networks.They are:
Point-to-Point Communication
The point-to-point connection is one of the line configuration methods that explains
how two communication devices are connected in a link. It is a unicast connection. A
dedicated link exists between each pair of sender and receiver. The entire channel's
capacity is reserved solely for packet transmission between the sender and receiver.
Multipoint Communication:
A multipoint connection is one that connects more than two devices together.
Multidrop line configuration is another name for the multipoint connection. Numerous
devices share a single link in a multipoint connection. As a result, it is possible to say
that all devices connected to the link temporarily share the channel capacity. The
devices use a turn-by-turn link, which is called a time-shared line configuration.
In a broadcast network, the packet transmitted by the sender is received and processed
by each device on the link. However, the receiver evaluates whether the packet belongs
to it or not based on the address field in the packet; if it does not, the packet is
discarded. If the packet belongs to the recipient, store it and respond appropriately to
the sender.
Topology
Topology defines the structure of the network of how all the components are
interconnected to each other. There are two types of topology: physical and logical
topology.
Bus Topology
o The bus topology is designed in such a way that all the stations are connected through
a single cable known as a backbone cable.
o Each node is either connected to the backbone cable by drop cable or directly
connected to the backbone cable.
o When a node wants to send a message over the network, it puts a message over the
network. All the stations available in the network will receive the message whether it
has been addressed or not.
o The bus topology is mainly used in 802.3 (ethernet) and 802.4 standard networks.
o The configuration of a bus topology is quite simpler as compared to other topologies.
o The backbone cable is considered as a "single lane" through which the message is
broadcast to all the stations.
o Limited failure: A failure in one node will not have any effect on other nodes.
Ring Topology
o Ring topology is like a bus topology, but with connected ends.
o The node that receives the message from the previous computer will retransmit to the
next node.
o The data flows in one direction, i.e., it is unidirectional.
o The data flows in a single loop continuously known as an endless loop.
o It has no terminated ends, i.e., each node is connected to other node and having no
termination point.
o The data in a ring topology flow in a clockwise direction.
o The most common access method of the ring topology is token passing.
o Token passing: It is a network access method in which token is passed from
one node to another node.
o Token: It is a frame that circulates around the network
Star Topology
Mesh topology
o Full Mesh Topology: In a full mesh topology, each computer is connected to all the
computers available in the network.
o Partial Mesh Topology: In a partial mesh topology, not all but certain computers are
connected to those computers with which they communicate frequently.
Reliable: The mesh topology networks are very reliable as if any link breakdown will
not affect the communication between connected computers.
Easier Reconfiguration: Adding new devices would not disrupt the communication
between other devices.
Hybrid Topology
Protocols
A Protocol is a set of rules that mainly govern data communications. The protocol
mainly defines what is communicated, how it is communicated, and when it is
communicated.
Syntax This term mainly refers to the structure or format of the data which
simply means the order in which data is presented. For example, A simple
protocol might expect the first 8 bits of data to be the address of the sender,
then the second 8 bits to be the address of the receiver, and then the rest of
the stream to be the message itself.
Semantics This term mainly refers to the meaning of each section of bits. How
does a particular pattern to be interpreted, and On the basis of interpretation
what action is to be taken? For example, does an address identify the route to
be taken or the final destination of the message?
Timing This term mainly refers to two characteristics: At what time the data
should be sent and how fast data can be sent. For example, if a sender
produces data at 100 Mbps but the receiver can process data at only 1 Mbps,
the transmission will overload the receiver and there will be some data loss.
Standards
Standards are essential in creating and maintaining an open and creative market for
the equipment manufacturers and they also guarantee the national and international
interoperability of the data, telecommunication technology, and process.
At the lowest layer of the OSI reference model, the physical layer is
responsible for transmitting unstructured data bits across the
network between the physical layers of the sending and receiving devices.
In other words, it takes care of the transmission of raw bit streams.
The data link layer corrects any errors that may have occurred at the
physical layer. It ensures that any data transfer is error-free between nodes
over the physical layer. It is responsible for reliable transmission of data
frames between connected nodes.
The data is packaged into frames here and transferred node-to-node. The
data layer has the following sub-layers
Two examples of the Transport Layer are the UDP (User Datagram
Protocol) and TCP (Transmission Control Protocol) that is build on top of
the Internet Protocol (IP model), which work at layer 3.
The application layer is where the user directly interacts with a software
application, so it is closest to the end user. When the user wants to
transmit files or pictures, this layer interacts with the application
communicating with the network. The application layer identifies
resources, communication partners, and synchronizes communication.
Other functions of the application layer are the Network Virtual Terminal
and FTAM-File transfer access, and mail/directory services. The protocol
used depends on the information the user wants to send. Some common
protocols include:
Transmission modes
o The way in which data is transmitted from one device to another device is known
as transmission mode.
o The transmission mode is also known as the communication mode.
o Each communication channel has a direction associated with it, and transmission media
provide the direction. Therefore, the transmission mode is also known as a directional
mode.
o The transmission mode is defined in the physical layer.
Simplex mode
o In Simplex mode, the communication is unidirectional, i.e., the data flow in one
direction.
o A device can only send the data but cannot receive it or it can receive the data but
cannot send the data.
o This transmission mode is not very popular as mainly communications require the two-
way exchange of data. The simplex mode is used in the business field as in sales that
do not require any corresponding reply.
o The radio station is a simplex channel as it transmits the signal to the listeners but
never allows them to transmit back.
o Keyboard and Monitor are the examples of the simplex mode as a keyboard can only
accept the data from the user and monitor can only be used to display the data on the
screen.
o The main advantage of the simplex mode is that the full capacity of the communication
channel can be utilized during transmission.
Half-Duplex mode
o In a Half-duplex channel, direction can be reversed, i.e., the station can transmit and
receive the data as well.
o Messages flow in both the directions, but not at the same time.
o The entire bandwidth of the communication channel is utilized in one direction at a
time.
o In half-duplex mode, it is possible to perform the error detection, and if any error
occurs, then the receiver requests the sender to retransmit the data.
o A Walkie-talkie is an example of the Half-duplex mode. In Walkie-talkie, one party
speaks, and another party listens. After a pause, the other speaks and first party listens.
Speaking simultaneously will create the distorted sound which cannot be understood.
Full-duplex mode
o In Full duplex mode, the communication is bi-directional, i.e., the data flow in both the
directions.
o Both the stations can send and receive the message simultaneously.
o Full-duplex mode has two simplex channels. One channel has traffic moving in one
direction, and another channel has traffic flowing in the opposite direction.
o The Full-duplex mode is the fastest mode of communication between devices.
o The most common example of the full-duplex mode is a telephone network. When two
people are communicating with each other by a telephone line, both can talk and listen
at the same time.
Multiplexing
Multiplexing is a technique used to combine and send the multiple data streams over
a single medium. The process of combining the data streams is known as multiplexing
and hardware used for multiplexing is known as a multiplexer.
Advantages of Multiplexing:
o More than one signal can be sent over a single medium.
o The bandwidth of a medium can be utilized effectively.
Multiplexing Techniques
Advantages Of FDM:
Disadvantages Of FDM:
Applications Of FDM:
o Synchronous TDM
o Asynchronous TDM
Synchronous TDM
o A Synchronous TDM is a technique in which time slot is preassigned to every device.
o In Synchronous TDM, each device is given some time slot irrespective of the fact that
the device contains the data or not.
o If the device does not have any data, then the slot will remain empty.
o In Synchronous TDM, signals are sent in the form of frames. Time slots are organized
in the form of frames. If a device does not have data for a particular time slot, then the
empty slot will be transmitted.
o The most popular Synchronous TDM are T-1 multiplexing, ISDN multiplexing, and
SONET multiplexing.
o If there are n devices, then there are n slots.
Concept Of Synchronous TDM
In the above figure, the Synchronous TDM technique is implemented. Each device is
allocated with some time slot. The time slots are transmitted irrespective of whether
the sender has data to send or not.
o The capacity of the channel is not fully utilized as the empty slots are also transmitted
which is having no data. In the above figure, the first frame is completely filled, but in
the last two frames, some slots are empty. Therefore, we can say that the capacity of
the channel is not utilized efficiently.
o The speed of the transmission medium should be greater than the total speed of the
input lines. An alternative approach to the Synchronous TDM is Asynchronous Time
Division Multiplexing.
Asynchronous TDM
o An asynchronous TDM is also known as Statistical TDM.
o An asynchronous TDM is a technique in which time slots are not fixed as in the case of
Synchronous TDM. Time slots are allocated to only those devices which have the data
to send. Therefore, we can say that Asynchronous Time Division multiplexor transmits
only the data from active workstations.
o An asynchronous TDM technique dynamically allocates the time slots to the devices.
o In Asynchronous TDM, total speed of the input lines can be greater than the capacity
of the channel.
o Asynchronous Time Division multiplexor accepts the incoming data streams and
creates a frame that contains only data with no empty slots.
o In Asynchronous TDM, each slot contains an address part that identifies the source of
the data.
o The difference between Asynchronous TDM and Synchronous TDM is that many slots
in Synchronous TDM are unutilized, but in Asynchronous TDM, slots are fully utilized.
This leads to the smaller transmission time and efficient utilization of the capacity of
the channel.
o In Synchronous TDM, if there are n sending devices, then there are n time slots. In
Asynchronous TDM, if there are n sending devices, then there are m time slots where
m is less than n (m<n).
o The number of slots in a frame depends on the statistical analysis of the number of
input lines.
The above figure shows that the data part contains the address to determine the
source of the data.
Transmission media
o Transmission media is a communication channel that carries the information from the
sender to the receiver. Data is transmitted through the electromagnetic signals.
o The main functionality of the transmission media is to carry the information in the form
of bits through LAN(Local Area Network).
A twisted pair consists of two insulated copper wires arranged in a regular spiral
pattern.
Coaxial Cable
o Coaxial cable is very commonly used transmission media, for example, TV wire is usually
a coaxial cable.
o The name of the cable is coaxial as it contains two conductors parallel to each other.
o It has a higher frequency as compared to Twisted pair cable.
o The inner conductor of the coaxial cable is made up of copper, and the outer conductor
is made up of copper mesh. The middle core is made up of non-conductive cover that
separates the inner conductor from the outer conductor.
o The middle core is responsible for the data transferring whereas the copper mesh
prevents from the EMI(Electromagnetic interference).
Fibre Optic
o Fibre optic cable is a cable that uses electrical signals for communication.
o Fibre optic is a cable that holds the optical fibres coated in plastic that are used to send
the data by pulses of light.
o The plastic coating protects the optical fibres from heat, cold, electromagnetic
interference from other types of wiring.
o Fibre optics provide faster data transmission than copper wires.
Switching techniques
In large networks, there can be multiple paths from sender to receiver. The switching
technique will decide the best route for data transmission.
Switching technique is used to connect the systems for making one-to-one
communication.
Circuit Switching
o Circuit switching is a switching technique that establishes a dedicated path between
sender and receiver.
o In the Circuit Switching Technique, once the connection is established then the
dedicated path will remain to exist until the connection is terminated.
o Circuit switching in a network operates in a similar way as the telephone works.
o A complete end-to-end path must exist before the communication takes place.
o In case of circuit switching technique, when any user wants to send the data, voice,
video, a request signal is sent to the receiver then the receiver sends back the
acknowledgment to ensure the availability of the dedicated path. After receiving the
acknowledgment, dedicated path transfers the data.
o Circuit switching is used in public telephone network. It is used for voice transmission.
o Fixed data can be transferred at a time in circuit switching technology.
o Circuit establishment
o Data transfer
o Circuit Disconnect
Circuit Switching can use either of the two technologies:
o Crossbar Switch
o Multistage Switch
Crossbar Switch
The Crossbar switch is a switch that has n input lines and n output lines. The crossbar
switch has n2 intersection points known as crosspoints.
Multistage Switch
o Multistage Switch is made by splitting the crossbar switch into the smaller units and
then interconnecting them.
o It reduces the number of crosspoints.
o If one path fails, then there will be an availability of another path.
o Once the dedicated path is established, the only delay occurs in the speed of data
transmission.
o It takes a long time to establish a connection approx 10 seconds during which no data
can be transmitted.
o It is more expensive than other switching techniques as a dedicated path is required
for each connection.
o It is inefficient to use because once the path is established and no data is transferred,
then the capacity of the path is wasted.
o In this case, the connection is dedicated therefore no other data can be transferred
even if the channel is free.
Message Switching
o Message Switching is a switching technique in which a message is transferred as a
complete unit and routed through intermediate nodes at which it is stored and
forwarded.
o In Message Switching technique, there is no establishment of a dedicated path
between the sender and receiver.
o The destination address is appended to the message. Message Switching provides a
dynamic routing as the message is routed through the intermediate nodes based on
the information available in the message.
o Message switches are programmed in such a way so that they can provide the most
efficient routes.
o Each and every node stores the entire message and then forward it to the next node.
This type of network is known as store and forward network.
o Message switching treats each message as an independent entity.
Advantages Of Message Switching
o Data channels are shared among the communicating devices that improve the
efficiency of using available bandwidth.
o Traffic congestion can be reduced because the message is temporarily stored in the
nodes.
o Message priority can be used to manage the network.
o The size of the message which is sent over the network can be varied. Therefore, it
supports the data of unlimited size.
o The message switches must be equipped with sufficient storage to enable them to
store the messages until the message is forwarded.
o The Long delay can occur due to the storing and forwarding facility provided by the
message switching technique.
Packet Switching
o The packet switching is a switching technique in which the message is sent in one go,
but it is divided into smaller pieces, and they are sent individually.
o The message splits into smaller pieces known as packets and packets are given a
unique number to identify their order at the receiving end.
o Every packet contains some information in its headers such as source address,
destination address and sequence number.
o Packets will travel across the network, taking the shortest path as possible.
o All the packets are reassembled at the receiving end in correct order.
o If any packet is missing or corrupted, then the message will be sent to resend the
message.
o If the correct order of the packets is reached, then the acknowledgment message will
be sent.
Expected Questions :
2. Compare and contrast the ISO OSI model with TCP/IP model.
7. Give advantages and disadvantages of fiber optic cable over metallic cable
8. Draw the B-ISDN reference model and explain the functions of each layer.
9. Explain about ATM. What are the advantages of using fixed length cells.
10. Explain X.25 network.
❖ The main responsibility of the Data Link Layer is to transfer the datagram
across an individual link.
❖ The Data link layer protocol defines the format of the packet exchanged
across the nodes as well as the actions such as Error detection,
retransmission, flow control, and random access.
❖ The Data Link Layer protocols are Ethernet, token ring, FDDI and PPP.
❖ Data link layer is responsible for converting data stream to signals bit by
bit and to send that over the underlying hardware.
❖ At the receiving end, Data link layer picks up data from hardware which
are in the form of electrical signals, assembles them in a recognizable
frame format, and hands over to upper layer.
❖ Data link layer has two sub-layers:
❖ Logical Link Control: It deals with protocols, flow-control, and error
control
❖ Media Access Control: It deals with actual control of media
• 1. Framing
2. Reliable delivery:
• Data Link Layer provides a reliable delivery service,
i.e., transmits the network layer datagram without any error.
• A reliable delivery service is accomplished with transmissions and
acknowledgements.
• 3. Flow Control
• Stations on same link may have different speed or capacity.
• Data-link layer ensures flow control that enables both machine to
exchange data on same speed.
4. Error detection:
5.Error correction:
Parts of a Frame
Types of Framing
Framing can be of two types, fixed sized framing and variable sized framing.
Computer Networks UNIT-2 prepared by K.TRIVENI ,Dept of CSE-MLRITM
Fixed-sized Framing
Here the size of the frame is fixed and so the frame length acts as delimiter of
the frame. Consequently, it does not require additional boundary bits to identify
the start and end of the frame.
Example − ATM cells.
Variable – Sized Framing
Here, the size of each frame to be transmitted may be different. So additional
mechanisms are kept to mark the end of one frame and the beginning of the
next frame.
It is used in local area networks.
Two ways to define frame delimiters in variable sized framing are −
• Length Field − Here, a length field is used that determines the size of the
frame. It is used in Ethernet (IEEE 802.3).
• End Delimiter − Here, a pattern is used as a delimiter to determine the
size of frame. It is used in Token Rings. If the pattern occurs in the
message, then two approaches are used to avoid the situation –
•
o Byte – Stuffing − A byte is stuffed in the message to differentiate
from the delimiter. This is also called character-oriented framing.
o Bit – Stuffing − A pattern of bits of arbitrary length is stuffed in the
message to differentiate from the delimiter. This is also called bit –
oriented framing.
Error Detection
When data is transmitted from one device to another device, the system does not
guarantee whether the data received by the device is identical to the data
transmitted by another device.
An Error is a situation when the message received at the receiver end is not
identical to the message transmitted.
o Single-Bit Error
o Burst Error
Single-Bit Error:
The only one bit of a given data unit is changed from 1 to 0 or from 0 to 1.
In the above figure, the message which is sent is corrupted as single-bit, i.e., 0
bit is changed to 1.
Types of Errors
Single-Bit Error does not appear more likely in Serial Data Transmission. For
example, Sender sends the data at 10 Mbps, this means that the bit lasts only for
1 ?s and for a single-bit error to occurred, a noise must be more than 1 ?s.
Burst Error:
The two or more bits are changed from 0 to 1 or from 1 to 0 is known as Burst
Error.
The Burst Error is determined from the first corrupted bit to the last corrupted
bit.
The duration of noise in Burst Error is more than the duration of noise in
Single-Bit.
The number of affected bits depends on the duration of the noise and data rate.
In Error Detection, the receiver only needs to know that the received codeword
is invalid; But in Error Correction the receiver needs to guess the Original
codeword that is sent. In this way, error Correction is much more difficult than
Error Detection.
The need for redundant bits is more during error correction rather than for error
detection.
In order to detect or correct the errors, there is a need to send some extra bits
along with the data. These extra bits are commonly known as Redundant bits.
As we had learned in the previous tutorial that original data is divided into
segments of k bits; it is referred to as dataword. When we add r redundant bits
to each block in order to make the length;n=k+r then it is referred to
as Codeword.
1. Whenever an error discovered, the receiver can have the sender in order
to retransmit the entire data unit. This technique is known as
the Backward Error correction technique. This technique is simple and
inexpensive in the case of wired transmission like fiber optics; there is no
expense in retransmitting the data. In the case of wireless transmission,
retransmission costs too much thus forward error correction technique is
used then.
2. The receiver can use an error-correcting code that automatically contains
certain errors. This technique is known as the Forward Error
Correction technique.
In order to correct the errors, one has to know the exact position of the error.
For example, In case if we want to calculate a single-bit error, the error
correction code then mainly determines which one of seven bits is in the error.
2r= d+r+1
Error correction is mainly done with the help of the Hamming code.
Hamming Code
Let's say you have received a 7-bit Hamming code which is 1011011.
The redundant bits are some extra binary bits that are not part of the original
data, but they are generated & added to the original data bit. All this is done to
ensure that the data bits don't get damaged and if they do, we can recover them.
Now the question arises, how do we determine the number of redundant bits to
be added?
We use the formula, 2r >= m+r+1; where r = redundant bit & m = data bit.
From the formula we can make out that there are 4 data bits and 3 redundancy
bits, referring to the received 7-bit hamming code.
To proceed further we need to know about parity bit, which is a bit appended
to the data bits which ensures that the total number of 1's are even (even parity)
or odd (odd parity).
As we go through the example, the first step is to identify the bit position of the
data & all the bit positions which are powers of 2 are marked as parity bits (e.g.
1, 2, 4, 8, etc.). The following image will help in visualizing the received
hamming code of 7 bits.
First, we need to detect whether there are any errors in this received hamming
code.
Step 1: For checking parity bit P1, use check one and skip one method, which
means, starting from P1 and then skip P2, take D3 then skip P4 then take D5,
and then skip D6 and take D7, this way we will have the following bits,
As we can observe the total number of bits is odd so we will write the value of
parity bit as P1 = 1. This means the error is there.
Step 2: Check for P2 but while checking for P2, we will use the check two and
skip two methods, which will give us the following data bits. But remember
since we are checking for P2, so we have to start our count from P2 (P1 should
not be considered).
Step 3: Check for P4 but while checking for P4, we will use the check four
and skip four methods, which will give us the following data bits. But
remember since we are checking for P4, so we have started our count from
P4(P1 & P2 should not be considered).
As we can observe that the number of 1's is odd, then we will write the value
of P4 = 1. This means the error is there.
So, from the above parity analysis, P1 & P4 are not equal to 0, so we can clearly
say that the received hamming code has errors.
Since we found that the received code has an error, so now we must correct
them. To correct the errors, use the following steps:
Now we have to determine the decimal value of this error word 101 which is 5
(22 *1 + 21 * 0 + 20 *1 = 5).
If the resultant of this division is zero which means that it has no error, and the
data is accepted.
If the resultant of this division is not zero which means that the data consists of
an error. Therefore, the data is discarded.
CRC Generator
o A CRC generator uses a modulo-2 division. Firstly, three zeroes are
appended at the end of the data as the length of the divisor is 4 and we
know that the length of the string 0s to be appended is always one less
than the length of the divisor.
o Now, the string becomes 11100000, and the resultant string is divided by
the divisor 1001.
o The remainder generated from the binary division is known as CRC
remainder. The generated value of the CRC remainder is 111.
o CRC remainder replaces the appended string of 0s at the end of the data
unit, and the final string would be 11100111 which is sent across the
network.
Error Correction codes are used to detect and correct the errors when data is
transmitted from the sender to the receiver.
A single additional bit can detect the error, but cannot correct it.
For correcting the errors, one has to know the exact position of the error. For
example, If we want to calculate a single-bit error, the error correction code will
determine which one of seven bits is in error. To achieve this, we have to add
some additional redundant bits.
Suppose r is the number of redundant bits and d is the total number of the data
bits. The number of redundant bits r can be calculated by using the formula:
2r>=d+r+1
The value of r is calculated by using the above formula. For example, if the
value of d is 4, then the possible smallest value that satisfies the above relation
would be 3.
Hamming Code
Parity bits: The bit which is appended to the original data of binary bits so that
the total number of 1s is even or odd.
Even parity: To check for even parity, if the total number of 1s is even, then
the value of the parity bit is 0. If the total number of 1s occurrences is odd, then
the value of the parity bit is 1.
Odd Parity: To check for odd parity, if the total number of 1s is even, then the
value of parity bit is 1. If the total number of 1s is odd, then the value of parity
bit is 0.
LRC:-
It is also known as 2-D parity check. In this method, data which the user want to
send is organised into tables of rows and columns. A block of bit is divided into
table or matrix of rows and columns. In order to detect an error, a redundant bit
is added to the whole block and this block is transmitted to receiver. The
receiver uses this redundant row to detect error. After checking the data for
errors, receiver accepts the data and discards the redundant row of bits.
Figure: LRC
In this matrix of bits, a parity bit (odd or even) is calculated for each column. It
means 32 bits data plus 8 redundant bits are transmitted to receiver. Whenever
data reaches at the destination, receiver uses LRC to detect error in data.
Advantage :
LRC is used to detect burst errors.
Example : Suppose 32 bit data plus LRC that was being transmitted is hit by a
burst error of length 5 and some bits are corrupted as shown in the following
figure :
In this example 1st and 6th bit in one data unit is changed . Also the 1st and 6th
bit in second unit is changed.
Flow Control
When a data frame (Layer-2 data) is sent from one host to another over a single
medium, it is required that the sender and receiver should work at the same
speed. That is, sender sends at a speed on which the receiver can process and
accept the data.
If sender is sending too fast the receiver may be overloaded, (swamped) and
data may be lost.
Two types of mechanisms can be deployed to control the flow:
• Stop and Wait
This flow control mechanism forces the sender after transmitting a data
frame to stop and wait until the acknowledgement of the data-frame sent
is received.
Flow Control
o It is a set of procedures that tells the sender how much data it can transmit
before the data overwhelms the receiver.
o The receiving device has limited speed and limited memory to store the
data. Therefore, the receiving device must be able to inform the sending
device to stop the transmission temporarily before the limits are reached.
o It requires a buffer, a block of memory for storing the information until
they are processed.
o Stop-and-wait
o Sliding window
Stop-and-wait
Computer Networks UNIT-2 prepared by K.TRIVENI ,Dept of CSE-MLRITM
o In the Stop-and-wait method, the sender waits for an acknowledgement
after every frame it sends.
o When acknowledgement is received, then only next frame is sent. The
process of alternately sending and waiting of a frame continues until the
sender transmits the EOT (End of transmission) frame.
Advantage of Stop-and-wait
Sliding Window
Error Control
There are three types of techniques available which Data-link layer may deploy
to control the errors by Automatic Repeat Requests (ARQ):
• Stop-and-wait ARQ
Go-Back-N ARQ
Stop and wait ARQ mechanism does not utilize the resources at their best.When
the acknowledgement is received, the sender sits idle and does nothing. In Go-
Back-N ARQ method, both sender and receiver maintain a window.
When the sender sends all the frames in window, it checks up to what sequence
number it has received positive acknowledgement.
If all frames are positively acknowledged, the sender sends next set of frames. If
sender finds that it has received NACK or has not receive any ACK for a
particular frame, it retransmits all the frames after which it does not receive any
positive ACK.
Before understanding the stop and Wait protocol, we first know about the error
control mechanism. The error control mechanism is used so that the received
data should be exactly same whatever sender has sent the data. The error control
mechanism is divided into two categories, i.e., Stop and Wait ARQ and sliding
window. The sliding window is further divided into two categories, i.e., Go
Here stop and wait means, whatever the data that sender wants to send, he sends
the data to the receiver. After sending the data, he stops and waits until he
receives the acknowledgment from the receiver. The stop and wait protocol is a
flow control protocol where flow control is one of the services of the data link
layer.
It is a data-link layer protocol which is used for transmitting the data over the
noiseless channels. It provides unidirectional data transmission which means
that either sending or receiving of data will take place at a time. It provides
flow-control mechanism but does not provide any error control mechanism.
The idea behind the usage of this frame is that when the sender sends the frame
then he waits for the acknowledgment before sending the next frame.
Sender side
Rule 2: Sender sends the next packet only when it receives the acknowledgment
of the previous packet.
Therefore, the idea of stop and wait protocol in the sender's side is very simple,
i.e., send one packet at a time, and do not send another packet before receiving
the acknowledgment.
Receiver side
Rule 2: When the data packet is consumed, receiver sends the acknowledgment
to the sender.
The above figure shows the working of the stop and wait protocol. If there is a
sender and receiver, then sender sends the packet and that packet is known as a
data packet. The sender will not send the second packet without receiving the
acknowledgment of the first packet. The receiver sends the acknowledgment for
the data packet that it has received. Once the acknowledgment is received, the
sender sends the next packet. This process continues until all the packet are not
sent. The main advantage of this protocol is its simplicity but it has some
disadvantages also. For example, if there are 1000 data packets to be sent, then
all the 1000 packets cannot be sent at a time as in Stop and Wait protocol, one
packet is sent at a time.
The following are the problems associated with a stop and wait protocol:
Suppose the sender sends the data and it has also been received by the receiver.
On receiving the packet, the receiver sends the acknowledgment. In this case,
the acknowledgment is lost in a network, so there is no chance for the sender to
receive the acknowledgment. There is also no chance for the sender to send the
next packet as in stop and wait protocol, the next packet cannot be sent until the
acknowledgment of the previous packet is received.
Suppose the sender sends the data and it has also been received by the receiver.
The receiver then sends the acknowledgment but the acknowledgment is
received after the timeout period on the sender's side.
Noiseless Channels
Simplest Protocol
Step 1 − Simplest protocol that does not have flow or error control.
Step 2 − It is a unidirectional protocol where data frames are traveling in one
direction that is from the sender to receiver.
Stop-and-Wait Protocol
Step 1 − If the data frames that arrive at the receiver side are faster than they
can be processed, the frames must be stored until their use.
Step 2 − Generally, the receiver does not have enough storage space, especially
if it is receiving data from many sources. This may result in either discarding of
frames or denial of service.
Step 3 − To prevent the receiver from becoming overwhelmed with frames, the
sender must slow down. There must be ACK from the receiver to the sender.
Step 4 − In this protocol the sender sends one frame, stops until it receives
confirmation from the receiver, and then sends the next frame.
Step 5 − We still have unidirectional communication for data frames, but
auxiliary ACK frames travel from the other direction. We add flow control to
the previous protocol.
There are three types of requests for the noisy channels, which are as follows −
• Stop & wait Automatic Repeat Request.
• Go-Back-N Automatic Repeat Request.
• Selective Repeat Automatic Repeat Request.
Noiseless channels are generally non-existent channels. We can ignore the error
or we need to add error control to our protocols.
Go-Back-N ARQ
Components of PPP
PPP is a byte - oriented protocol where each field of the frame is composed of
one or more bytes. The fields of a PPP frame are −
• Flag − 1 byte that marks the beginning and the end of the frame. The bit
pattern of the flag is 01111110.
• Address − 1 byte which is set to 11111111 in case of broadcast.
• Control − 1 byte set to a constant value of 11000000.
• Protocol − 1 or 2 bytes that define the type of data contained in the
payload field.
• Payload − This carries the data from the network layer. The maximum
length of the payload field is 1500 bytes. However, this may be negotiated
between the endpoints of communication.
• FCS − It is a 2 byte or 4 bytes frame check sequence for error detection.
The standard code used is CRC (cyclic redundancy code)
The data link layer is used in a computer network to transmit the data between
two devices or nodes. It divides the layer into parts such as data link
control and the multiple access resolution/protocol. The upper layer has the
responsibility to flow control and the error control in the data link layer, and
hence it is termed as logical of data link control. Whereas the lower sub-layer
is used to handle and reduce the collision or multiple access on a channel.
Hence it is termed as media access control or the multiple access resolutions.
Following are the types of multiple access protocol that is subdivided into the
different process as:
In this protocol, all the station has the equal priority to send the data over a
channel. In random access protocol, one or more stations cannot depend on
another station nor any station control another station.
Depending on the channel's state (idle or busy), each station transmits the data
frame.
However, if more than one station sends the data over a channel, there may be a
collision or data conflict.
Due to the collision, the data frame packets may be lost or changed. And hence,
it does not receive by the receiver end.
o Aloha
o CSMA
o CSMA/CD
o CSMA/CA
It is designed for wireless LAN (Local Area Network) but can also be used in a
shared medium to transmit data. Using this method, any station can transmit
data across a network simultaneously when a data frameset is available for
transmission.
Aloha Rules
Whenever data is available for sending over a channel at stations, we use Pure
Aloha. In pure Aloha, when each station transmits data to a channel without
checking whether the channel is idle or not, the chances of collision may occur,
and the data frame can be lost.
When any station transmits the data frame to a channel, the pure Aloha waits for
the receiver's acknowledgment.
If it does not acknowledge the receiver end within the specified time, the
station waits for a random amount of time, called the backoff time (Tb).
And the station may assume the frame has been lost or destroyed. Therefore, it
retransmits the frame until all the data are successfully transmitted to the
receiver.
Slotted Aloha
The slotted Aloha is designed to overcome the pure Aloha's efficiency because
pure Aloha has a very high possibility of frame hitting. In slotted Aloha, the
shared channel is divided into a fixed time interval called slots. So that, if a
station wants to send a frame to a shared channel, the frame can only be sent at
the beginning of the slot, and only one frame is allowed to be sent to each slot.
And if the stations are unable to send data to the beginning of the slot, the
station will have to wait until the beginning of the slot for the next time.
However, the possibility of a collision remains when trying to send a frame at
the beginning of two or more station time slot.
It means that if the channel is idle, the station can send data to the channel.
Otherwise, it must wait until the channel becomes idle. Hence, it reduces the
chances of a collision on a transmission medium.
1-Persistent: In the 1-Persistent mode of CSMA that defines each node, first
sense the shared channel and if the channel is idle, it immediately sends the
data. Else it must wait and keep track of the status of the channel to be idle and
broadcast the frame unconditionally as soon as the channel is idle.
CSMA/ CD
Therefore, it first senses the shared channel before broadcasting the frames, and
if the channel is idle, it transmits a frame to check whether the transmission was
successful.
If any collision is detected in the CSMA/CD, the station sends a jam/ stop
signal to the shared channel to terminate data transmission.
After that, it waits for a random time before sending a frame to a channel.
CSMA/ CA
If the station receives only a single (own) acknowledgments, that means the
data frame has been successfully transmitted to the receiver.
But if it gets two signals (its own and one more in which the collision of
frames), a collision of the frame occurs in the shared channel.
Following are the methods used in the CSMA/ CA to avoid the collision:
Interframe space: In this method, the station waits for the channel to become
idle, and if it gets the channel is idle, it does not immediately send the data.
Instead of this, it waits for some time, and this time period is called
the Interframe space or IFS. However, the IFS time is often used to define the
priority of the station.
Contention window: In the Contention window, the total time is divided into
different slots. When the station/ sender is ready to transmit the data frame, it
chooses a random slot number of slots as wait time. If the channel is still busy,
it does not restart the entire process, except that it restarts the timer only to send
data packets when the channel is inactive.
Computer Networks UNIT-2 prepared by K.TRIVENI ,Dept of CSE-MLRITM
Acknowledgment: In the acknowledgment method, the sender station sends the
data frame to the shared channel if the acknowledgment is not received ahead of
time.
The following figure shows a situation with five stations and a five-slot
reservation frame. In the first interval, only stations 1, 3, and 4 have made
reservations. In the second interval, only station 1 has made a
reservation.
Token Passing
• In token passing scheme, the stations are connected logically to each other in
form of ring and access to stations is governed by tokens.
• A token is a special bit pattern or a small message, which circulate from one
station to the next in some predefined order.
• In Token ring, token is passed from one station to another adjacent station in
the ring whereas incase of Token bus, each station uses the bus to send the
token to the next station in some predefined order.
• In both cases, token represents permission to send. If a station has a frame
queued for transmission when it receives the token, it can send that frame
Channelization :-
Any station that wants to receive data from one of the other three multiplies the
data on the channel by the code of the sender. For example, suppose stations 1
and 2 are talking to each other. Station 2 wants to hear what station 1 is saying.
It multiplies the data on the channel by c1 the code of station1.
Because (c1.c1) is 4, but (c2 . c1), (c3. c1), and (c4 .c1) are all 0s, station 2
divides the result by 4 to get the data from station1.
data =(d1.c1+d2.c2+d3.c3+d4.c4).c1
= c1. d1. c1+ c1. d2. c2+ c1. d3. c3+ c1. d4. c4= 4d1
Transfer Modes
HDLC supports two types of transfer modes, normal response mode and
asynchronous balanced mode.
• Normal Response Mode (NRM) − Here, two types of stations are there,
a primary station that send commands and secondary station that can
respond to received commands. It is used for both point - to - point and
multipoint communications.
HDLC Frame
HDLC is a bit - oriented protocol where each frame contains up to six fields.
The structure varies according to the type of frame. The fields of a HDLC
frame are −
• Flag − It is an 8-bit sequence that marks the beginning and the end of the
frame. The bit pattern of the flag is 01111110.
• Address − It contains the address of the receiver. If the frame is sent by
the primary station, it contains the address(es) of the secondary station(s).
If it is sent by the secondary station, it contains the address of the primary
station. The address field may be from 1 byte to several bytes.
• Control − It is 1 or 2 bytes containing flow and error control information.
• Payload − This carries the data from the network layer. Its length may
vary from one network to another.
• FCS − It is a 2 byte or 4 bytes frame check sequence for error detection.
The standard code used is CRC (cyclic redundancy code)
There are three types of HDLC frames. The type of frame is determined by the
control field of the frame −
• I-frame − I-frames or Information frames carry user data from the
network layer. They also include flow and error control information that is
piggybacked on user data. The first bit of control field of I-frame is 0.
• S-frame − S-frames or Supervisory frames do not contain information
field. They are used for flow and error control when piggybacking is not
required. The first two bits of control field of S-frame is 10.
• U-frame − U-frames or Un-numbered frames are used for myriad
miscellaneous functions, like link management. It may contain an
information field, if required. The first two bits of control field of U-frame
is 11.
Ethernet is a set of technologies and protocols that are used primarily in LANs.
It was first standardized in 1980s by IEEE 802.3 standard.
IEEE 802.3 defines the physical layer and the medium access control (MAC)
sub-layer of the data link layer for wired Ethernet networks.
Ethernet is classified into two categories: classic Ethernet and switched
Ethernet.
Classic Ethernet is the original form of Ethernet that provides data rates
between 3 to 10 Mbps. The varieties are commonly referred as 10BASE-X.
Here, 10 is the maximum throughput, i.e. 10 Mbps, BASE denoted use of
baseband transmission, and X is the type of medium used. Most varieties of
classic Ethernet have become obsolete in present communication scenario.
A switched Ethernet uses switches to connect to the stations in the LAN. It
replaces the repeaters used in classic Ethernet and allows full bandwidth
utilization.
detection.
Token ring is the IEEE 802.5 standard for a token-passing ring in transmission
networks.
In a token ring, a special bit pattern, known as a token, circulates around the
ring when all the stations are idle.
Token Ring is formed by the nodes connected in ring format.
The principle used in the token ring network is that a token is circulating in the
ring, and whichever node grabs that token will have the right to transmit the
data.
Differences
The major differences between IEEE 802.3 and IEEE 802.5 are as follows −
The maximum size of the frame The maximum size of the frame in
in 802.3 is 1572 bytes. 802.5 is variable.
The maximum size of the data There is no limit on the maximum size
field is 0 to 1500 bytes. of the data that can be sent.
Wireless LANs are those Local Area Networks that use high frequency radio
waves instead of cables for connecting the devices in LAN. Users connected by
• They provide clutter free homes, offices and other networked places.
• The LANs are scalable in nature, i.e. devices may be added or removed
from the network at a greater ease than wired LANs.
• The system is portable within the network coverage and access to the
network is not bounded by the length of the cables.
• Installation and setup is much easier than wired counterparts.
• The equipment and setup costs are reduced.
Disadvantages of WLANs
• Since radio waves are used for communications, the signals are noisier
with more interference from nearby systems.
• Greater care is needed for encrypting information. Also, they are more
prone to errors. So, they require greater bandwidth than the wired LANs.
• WLANs are slower than wired LANs.
Internetworking:
The word “internetworking,” which combines the words “inter” and “networking,” denotes a connection
between completely distinct nodes/segments. This connection is made possible by intermediary hardware
like routers or gateways. Private, public, commercial, industrial, and governmental networks frequently
connect to one another. Therefore, a degree of internetwork could be a collection of several networks that
operate as a single large network and are connected by intermediate networking devices. The trade, goods,
and methods used to address the difficulty of creating and managing internet works are referred to as
internetworking.
A simple extension of a LAN is the use of a switch or hub to join two local area networks, but connecting
them via a router is an example of internetworking. The OSI-ISO model’s Layer 3 (Network Layer) enforces
internetworking. The internet is the most prominent famous example of internetworking.
Types of Internetworking
Internetworking primarily consists of three units: Extranet, Internet, and Intranet.
Extranet
It’s a network of the internetwork with a confined scope to one organisation or institution but with limited
links to one or more other networks on occasion; however, this is not always the case. It is the lowest degree
of internet usage and is typically prohibited in extremely private areas. An extranet may also be referred to
as a MAN, WAN, or another type of network, but it cannot include a single local area network; rather, it
must make at least one mention of an external network.
Internet
Internet is a specific internetworking that connects governmental, academic, public, and private networks on
a global scale. It is also the location of the World Wide Web (WWW) and is referred to as the “Internet” to
distinguish it from other generic internetworking. Internet users and their service providers utilise IP
addresses obtained from address registries that control assignments.
Intranet
This computer network can be a collection of interconnected networks that employ the Internet Protocol and
IP-based software like web browsers as well as FTP tools, all of which are controlled by a single body entity.
This body entity blocks access to the computer network for the rest of the world and only allows a select few
users. This network most frequently refers to the internal network of a business or other enterprise. To
provide users with browseable data, a large computer network can typically have its own internet server.
Internetwork Addressing
The internetwork addresses set up devices singly or collectively. Depending on the protocol family and
because of the OSI layer, addressing strategies vary. DLL, MAC addresses, and network-layer addresses are
the three types of internetwork address area units that are typically employed.
DLL Addresses
All the physical network associations of network devices are clearly identified by a data-link layer address.
Area units are frequently used as physical addresses or hardware addresses in data-link addresses. Data-link
addresses can occasionally be found within a flat address space and are pre-configured with a fixed
relationship to a particular device. End systems typically only have one data-link address since they only
have one physical network association. As a result of having many physical network connections, routers
and other internetworking equipment frequently have various data-link addresses.
MAC Addresses
Data-link layer addresses are included in MAC addresses. MAC addresses create network entities in LANs
that use the data-link layer’s IEEE MAC addresses. For each local area network interface, a unique MAC
address designates a particular area unit. MAC addresses are expressed as twelve hexadecimal numbers and
are forty-eight bits long. The Organisational Unique Identifier (OUI) is made up of the first 12 hexadecimal
digits, which are typically managed by the IEEE and identify the maker or seller.
The interface serial variety or the other price set by a specific merchant would be represented by the final
half a dozen positional notation digits. When an interface card initialises, MAC addresses are routinely traced
into RAM from ROM, where they are known as burned-in addresses (abbreviated as BIAs).
When data is tunnelled, it is split into smaller parts called packets, as it travels through the tunnel. The
packets are encrypted via the tunnel, and another process known as encapsulation takes place. For
transmission, private network data and protocol details are encased in public network transmission units.
The units have the appearance of public data, allowing them to be sent via the Internet. Encapsulation
enables packets to reach their intended destination. De-capsulation and decryption take place at the final
destination.
Address Mapping:
1. Error Message
2. Query Message
Error Message
The error messages report the problems which may be faced by the hosts or routers when they process
the IP packet.
Query Message
The ICMP protocol can diagnose some network problems also. Query messages help the hosts to get
some specific information from a router or another host.
IGMP:
o IGMP stands for Internet Group Message Protocol.
o The IP protocol supports two types of communication:
o Unicasting: It is a communication between one sender and one receiver. Therefore, we can say that
it is one-to-one communication.
o Multicasting: Sometimes the sender wants to send the same message to a large number of receivers
simultaneously. This process is known as multicasting which has one-to-many communication.
o The IGMP protocol is used by the hosts and router to support multicasting.
o The IGMP protocol is used by the hosts and router to identify the hosts in a LAN that are the
members of a group.
o IGMP is a part of the IP layer, and IGMP has a fixed-size message.
o The IGMP message is encapsulated within an IP datagram.
Where,
Type: It determines the type of IGMP message. There are three types of IGMP message: Membership Query,
Membership Report and Leave Report.
Maximum Response Time: This field is used only by the Membership Query message. It determines the
maximum time the host can send the Membership Report message in response to the Membership Query
message.
Checksum: It determines the entire payload of the IP datagram in which IGMP message is encapsulated.
Routing refers to the network-wide process that determines the end-to-end paths that packets take from
source to destination.
In Network layer, a router is used to forward the packets. Every router has a forwarding table. A router
forwards a packet by examining a packet's header field and then using the header field value to index into
the forwarding table. The value stored in the forwarding table corresponding to the header field value
indicates the router's outgoing interface link to which the packet is to be forwarded.
For example, the router with a header field value of 0111 arrives at a router, and then router indexes this
header value into the forwarding table that determines the output link interface is 2. The router forwards the
packet to the interface 2. The routing algorithm determines the values that are inserted in the forwarding
table. The routing algorithm can be centralized or decentralized.
Routing Protocols:
Routing Protocols are the set of defined rules used by the routers to communicate between source &
destination. They do not move the information to the source to a destination, but only update the routing
table that contains the information.
Network Router protocols helps you to specify way routers communicate with each other. It allows the
network to select routes between any two nodes on a computer network.
Static
Dynamic
Static routing protocols are used when an administrator manually assigns the path from source to the
destination network. It offers more security to the network.
Advantages
Disadvantages
Dynamic routing protocols are another important type of routing protocol. It helps routers to add
information to their routing tables from connected routers automatically. These types of protocols also
send out topology updates whenever the network changes’ topological structure.
Advantage:
Disadvantage:
In the Distance Vector routing protocol, when a route becomes unavailable, all routing tables need to be
updated with new information.
Example – Consider 3-routers X, Y and Z as shown in figure. Each router have their routing table.
Every routing table will contain distance to the destination nodes.
Consider router X , X will share it routing table to neighbors and neighbors will share it routing table to
it to X and distance from node X to destination will be calculated using bellmen- ford equation.
Dx(y) = min { C(x,v) + Dv(y)} for each node y ∈ N
As we can see that distance will be less going from X to Z when Y is intermediate node(hop) so it will
be update in routing table X.
Link state database – A collection of information gathered from the link-state packet.
This protocol maintains separate tables for both the best route and the backup routes, so it has
more knowledge of the inter-network than any other distance vector routing protocol.
Concept of triggered updates are used, so it does not consume any unnecessary bandwidth.
Partial updates will be triggered when there is a topology change, so it does not need to update
where the whole routing table is exchanged.
This type of routing protocol sends updated router table data when changes are made. Therefore, there is
no auto-discovery of topology changes, which means that the user needs to configure BGP manually.
Expected Questions:
The data link layer is responsible for delivery of frames between two neigh boring
nodes over a link. This is called node-to-node delivery. The network layer is
responsible for delivery of datagrams between two hosts. This is called host-to-
host delivery. Real communication takes place between two processes
(application programs). We need process-to-process delivery. The transport layer
is responsible for process-to-process delivery-the delivery of a packet, part of a
message, from one process to another. Figure 4.1 shows these three types of
deliveries and their domains
1. Client/Server Paradigm
Although there are several ways to achieve process-to-process communication,
the most common one is through the client/server paradigm. A process on the
local host, called a client, needs services from a process usually on the remote
host, called a server. Both processes (client and server) have the same name. For
example, to get the day and time from a remote machine, we need a Daytime
client process running on the local host and a Daytime server process running on
a remote machine. For communication, we must define the following:
1. Local host
2. Local process
3. Remote host
4. Remote process
2. Addressing
Whenever we need to deliver something to one specific destination among many,
we need an address. At the data link layer, we need a MAC address to choose one
node among several nodes if the connection is not point-to-point. A frame in the
data link layer needs a Destination MAC address for delivery and a source address
for the next node's reply.
Figure 4.2 shows this concept.
The IP addresses and port numbers play different roles in selecting the final
destination of data. The destination IP address defines the host among the
different hosts in the world. After the host has been selected, the port number
defines one of the processes on this particular host (see Figure 4.3).
3.Multiplexing and Demultiplexing
Demultiplexing
At the receiver site, the relationship is one-to-many and requires demultiplexing.
The transport layer receives datagrams from the network layer. After error
checking and dropping of the header, the transport layer delivers each message to
the appropriate process based on the port number.
UDP
o UDP stands for User Datagram Protocol.
o UDP is a simple protocol and it provides non sequenced transport functionality.
o UDP is a connectionless protocol.
o This type of protocol is used when reliability and security are less important
than speed and size.
o UDP is an end-to-end transport level protocol that adds transport-level
addresses, checksum error control, and length information to the data from the
upper layer.
o The packet produced by the UDP protocol is known as a user datagram.
User Datagram Format
The user datagram has a 16-byte header which is shown below:
Where,
o Source port address: It defines the address of the application process that has
delivered a message. The source port address is of 16 bits address.
o Destination port address: It defines the address of the application process that
will receive the message. The destination port address is of a 16-bit address.
o Total length: It defines the total length of the user datagram in bytes. It is a
16-bit field.
o Checksum: The checksum is a 16-bit field which is used in error detection.
TCP
o TCP stands for Transmission Control Protocol.
o It provides full transport layer services to applications.
o It is a connection-oriented protocol means the connection established between
both the ends of the transmission. For creating the connection, TCP generates
a virtual circuit between sender and receiver for the duration of a transmission.
o TCP is a connection-oriented protocol, which means that it first establishes the
connection between the sender and receiver in the form of a handshake. After both
the connections are verified, it begins transmitting packets. It makes the transmission
process error-free and ensures the delivery of data. It is an important part of the
communication protocols used to interconnect network devices on the internet. The
whole internet system relies on this network.
o TCP is one of the most common protocols that ensure end-to-end delivery. It
guarantees the security and integrity of the data being transmitted. It always establishes
a secure connection between the sender and receiver. The transmitter is the server, and
the receiver is known as the client. We can also say that the data transmission occurs
between the server and client. Hence, TCP is used in most of the high-level protocols,
such as FTP (File Transfer Protocol)
Where,
o URG: The URG field indicates that the data in a segment is urgent.
o ACK: When ACK field is set, then it validates the acknowledgement number.
o PSH: The PSH field is used to inform the sender that higher throughput is
needed so if possible, data must be pushed with higher throughput.
o RST: The reset bit is used to reset the TCP connection when there is any
confusion occurs in the sequence numbers.
o SYN: The SYN field is used to synchronize the sequence numbers in three types
of segments: connection request, connection confirmation ( with the ACK bit
set ), and confirmation acknowledgement.
o FIN: The FIN field is used to inform the receiving TCP module that the sender
has finished sending data. It is used in connection termination in three types of
segments: termination request, termination confirmation, and
acknowledgement of termination confirmation.
o Window Size: The window is a 16-bit field that defines the size of the
window.
o Checksum: The checksum is a 16-bit field used in error detection.
o Urgent pointer: If URG flag is set to 1, then this 16-bit field is an offset
from the sequence number indicating that it is a last urgent data byte.
o Options and padding: It defines the optional fields that convey the
additional information to the receiver.
o TCP Connection (A 3-way handshake)
o Handshake refers to the process to establish connection between the client and
server. Handshake is simply defined as the process to establish a
communication link. To transmit a packet, TCP needs a three way handshake
before it starts sending data. The reliable communication in TCP is termed
as PAR (Positive Acknowledgement Re-transmission). When a sender sends the
data to the receiver, it requires a positive acknowledgement from the receiver
confirming the arrival of data. If the acknowledgement has not reached the
sender, it needs to resend that data. The positive acknowledgement from the
receiver establishes a successful connection.
o Here, the server is the server and client is the receiver. The above diagram shows
3 steps for successful connection. A 3-way handshake is commonly known as
SYN-SYN-ACK and requires both the client and server response to exchange
the data. SYN means synchronize Sequence Number and ACK
means acknowledgment. Each step is a type of handshake between the sender
and the receiver.
o The diagram of a successful TCP connection showing the three handshakes is
shown below:
o
o The three handshakes are discussed in the below steps:
o Step 1: SYN
o SYN is a segment sent by the client to the server. It acts as a connection
request between the client and server. It informs the server that the client wants
to establish a connection. Synchronizing sequence numbers also helps
synchronize sequence numbers sent between any two devices, where the same
SYN segment asks for the sequence number with the connection request.
o Step 2: SYN-ACK
o It is an SYN-ACK segment or an SYN + ACK segment sent by the server. The
ACK segment informs the client that the server has received the connection
request and it is ready to build the connection. The SYN segment informs the
sequence number with which the server is ready to start with the segments.
o Step 3: ACK
o ACK (Acknowledgment) is the last step before establishing a successful TCP
connection between the client and server. The ACK segment is sent by the client
as the response of the received ACK and SN from the server. It results in the
establishment of a reliable data connection.
o After these three steps, the client and server are ready for the data
communication process. TCP connection and termination are full-duplex, which
means that the data can travel in both the directions simultaneously.
A TCP window is the amount of unacknowledged data a sender can send on a particular
connection before it gets an acknowledgment back from the receiver, that it has received some
of the data.
The working of the TCP sliding window mechanism can be explained as below.
The sending device can send all packets within the TCP window size (as specified in
the TCP header) without receiving an ACK, and should start a timeout timer for each of
them.
The receiving device should acknowledge each packet it received, indicating the sequence
number of the last well-received packet. After receiving the ACK from the receiving device,
the sending device slides the window to right side.
In this case, the sending device can send up to 5 TCP Segments without receiving an
acknowledgement from the receiving device. After receiving the acknowledgement for
Segment 1 from the receiving device, the sending device can slide its window one TCP
Segment to the right side and the sending device can transmit segment 6 also.
If any TCP Segment lost while its journey to the destination, the receiving device cannot
acknowledge the sender. Consider while transmission, all other Segments reached the
destination except Segment 3. The receiving device can acknowledge up to Segment 2. At the
sending device, a timeout will occur and it will re-transmit the lost Segment 3. Now the
receiving device has received all the Segments, since only Segment 3 was lost. Now the
receiving device will send the ACK for Segment 5, because it has received all the Segments to
Segment 5.
Acknowledgement (ACK) for Segment 5 ensures the sender the receiver has succesfully
received all the Segments up to 5.
TCP uses a byte level numbering system for communication. If the sequence number for a TCP
segment at any instance was 5000 and the Segment carry 500 bytes, the sequence number for
the next Segment will be 5000+500+1. That means TCP segment only carries the sequence
number of the first byte in the segment.
The Window size is expressed in number of bytes and is determined by the receiving device
when the connection is established and can vary later. You might have noticed when
transferring big files from one Windows machine to another, initially the time remaining
calculation will show a large value and will come down later.
The Send Window is the sum of Bytes sent but not acknowledged and Bytes the
Congestion Control Algorithms
What is Congestion?
When too many packets are present in the subnet performance degrades. This
situation is called
Congestion.
The number of packets dumped into the subnet are within its carrying
capacity, they are all
delivered.
However, if the traffic increases too far, the routers are unable to cope and
begin losing packets.
At very high traffic, performance collapse completely and almost no packets
are delivered.
1. Retransmission Policy :
It is the policy in which retransmission of the packets
are taken care of. If the sender feels that a sent packet
is lost or corrupted, the packet needs to be
retransmitted. This transmission may increase the
congestion in the network.
To prevent congestion, retransmission timers must be
designed to prevent congestion and also able to
optimize efficiency.
2. Window Policy :
The type of window at the sender’s side may also
affect the congestion. Several packets in the Go-back-
n window are re-sent, although some packets may be
received successfully at the receiver side. This
duplication may increase the congestion in the network
and make it worse.
Therefore, Selective repeat window should be adopted
as it sends the specific packet that may have been
lost.
3. Discarding Policy :
A good discarding policy adopted by the routers is that
the routers may prevent congestion and at the same
time partially discard the corrupted or less sensitive
packages and also be able to maintain the quality of a
message.
In case of audio file transmission, routers can discard
less sensitive packets to prevent congestion and also
maintain the quality of the audio file.
4. Acknowledgment Policy :
Since acknowledgements are also the part of the load
in the network, the acknowledgment policy imposed by
the receiver may also affect congestion. Several
approaches can be used to prevent congestion related
to acknowledgment.
The receiver should send acknowledgement for N
packets rather than sending acknowledgement for a
single packet. The receiver should send an
acknowledgment only if it has to send a packet or a
timer expires.
5. Admission Policy :
In admission policy a mechanism should be used to
prevent congestion. Switches in a flow should first
check the resource requirement of a network flow
before transmitting it further. If there is a chance of a
congestion or there is a congestion in the network,
router should deny establishing a virtual network
connection to prevent further congestion.
All the above policies are adopted to prevent congestion
before it happens in the network.
1. Backpressure :
Backpressure is a technique in which a congested node stops
receiving packets from upstream node. This may cause the
upstream node or nodes to become congested and reject
receiving data from above nodes. Backpressure is a node-to-
node congestion control technique that propagate in the
opposite direction of data flow. The backpressure technique
can be applied only to virtual circuit where each node has
information of its above upstream node.
3. Implicit Signaling :
In implicit signaling, there is no communication between the
congested nodes and the source. The source guesses that
there is congestion in a network. For example when sender
sends several packets and there is no acknowledgment for a
while, one assumption is that there is a congestion.
4. Explicit Signaling :
In explicit signaling, if a node experiences congestion it can
explicitly sends a packet to the source or destination to inform
about congestion. The difference between choke packet and
explicit signaling is that the signal is included in the packets
that carry data rather than creating a different packet as in
case of choke packet technique.
Explicit signaling can occur in either forward or backward
direction.
Forward Signaling : In forward signaling, a signal is
sent in the direction of the congestion. The destination
is warned about congestion. The receiver in this case
adopt policies to prevent further congestion.
Backward Signaling : In backward signaling, a signal
is sent in the opposite direction of the congestion. The
source is warned about congestion and it needs to
slow down.
• Generic Domains
• The generic domains define registered hosts according
to their generic behavior.
Domain Names
• Inverse DomainsInverse domain is used to map an
address to a name.
• For example, a client send a request to the server for
performing a particular task, server finds a list of
authorized client. The list contains only IP addresses of
the client.
• The server sends a query to the DNS server to map an
address to a name to determine if the client is on the
authorized list.
• This query is called an inverse query.
Electronic Mail
• Electronic Mail (e-mail) is one of most widely used services
of Internet. This service allows an Internet user to send a message in
formatted manner (mail) to the other Internet user in any part of
world. Message in mail not only contain text, but it also contains
images, audio and videos data. The person who is sending mail is
called sender and person who receives mail is called recipient. It is
just like postal mail service. Components of E-Mail System : The
basic components of an email system are : User Agent (UA), Message
Transfer Agent (MTA), Mail Box, and Spool file. These are explained
as following below.
Electronic Mail
1.User Agent (UA) : The UA is normally a program which is used to
send and receive mail. Sometimes, it is called as mail reader. It accepts
variety of commands for composing, receiving and replying to
messages as well as for manipulation of the mailboxes.
2.Message Transfer Agent (MTA) : MTA is actually responsible for
transfer of mail from one system to another. To send a mail, a system
must have client MTA and system MTA. It transfer mail to mailboxes
of recipients if they are connected in the same machine. It delivers
mail to peer MTA if destination mailbox is in another machine. The
delivery from one MTA to another MTA is done by Simple Mail
Transfer Protocol.
Electronic Mail
Electronic Mail
Mailbox : It is a file on local hard drive to collect mails. Delivered mails are
present in this file. The user can read it delete it according to his/her
requirement. To use e-mail system each user must have a mailbox . Access to
mailbox is only to owner of mailbox.
Spool file : This file contains mails that are to be sent. User agent appends
outgoing mails in this file using SMTP. MTA extracts pending mail from
spool file for their delivery. E-mail allows one name, an alias, to represent
several different e-mail addresses. It is known as mailing list, Whenever user
have to sent a message, system checks recipient’s name against alias database.
If mailing list is present for defined alias, separate messages, one for each
entry in the list, must be prepared and handed to MTA. If for defined alias,
there is no such mailing list is present, name itself becomes naming address
and a single message is delivered to mail transfer entity.
Services provided by E-mail system :
1. SNMP Manager –
It is a centralized system used to monitor network. It is also known as Network Management Station
(NMS)
2. SNMP agent –
It is a software management software module installed on a managed device. Managed devices
can be network devices like PC, routers, switches, servers, etc.