0% found this document useful (0 votes)
8 views26 pages

CN Unit 1

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 26

GURU NANAK INSTITUTIONS TECHNICAL CAMPUS

DEPARTMENT OF COMPUTER SCIENCE ENGINEERING


COMPUTER NETWORKS
III YEAR I SEM

1. INTRODUCTION TO COMPUTER NETWORKS

SYLLABUS:
Network hardware, Network software, OSI, TCP/IP Reference models, Example
Networks: ARPANET, Internet.
Physical Layer: Guided Transmission media: twisted pairs, coaxial cable, fiber
optics, Wireless Transmission.
Data link layer: Design issues, framing, Error detection and correction.

I. Network Definition:

A network can be defined as two or more computers connected together in such a way that they
can share resources.
The purpose of a network is to share resources.
A resource may be:
• A file
• A folder
• A printer
• A disk drive
• Or just about anything else that exists on a computer.

A network is simply a collection of computers or other hardware devices that are connected
together, either physically or logically, using special hardware and software,
To allow them to exchange information and cooperate. Networking is the term that describes
the processes involved in designing, implementing, upgrading, managing and otherwise
working with networks and network technologies.

Advantages of Networking
• Connectivity and Communication
• Data Sharing
• Hardware Sharing
• Internet Access
• Internet Access Sharing
• Data Security and Management
• Performance Enhancement and Balancing
• Entertainment

The Disadvantages (Costs) of Networking


• Network Hardware, Software and Setup Costs

Sreedevi Kadiyala Page 1


• Hardware and Software Management and Administration Costs
• Undesirable Sharing
• Illegal or Undesirable Behavior
• Data Security Concerns

II. Network Classifications Types:

1. LAN (Local Area Network)


2. MAN (Metropolitan Area Network)
3. WAN (Wide Area Network)

1. Local Area Networks (LANs):

A local area network (LAN) is a computer network covering a small geographic area, like a
home, office, or group of buildings

– small size
– transmission technology
• single cable
• 10Mbps ~ 10Gb/s
• 10Gb/s : 10,000,000.000 bps
– topology:
• bus
– Ethernet (IEEE 802.3): 10 or 100 Mbps (10Gb/s)
• ring
– IBM token ring (IEEE 802.5): 4 or 16 Mbps

2. MAN (Metropolitan Area Network):

A metropolitan area network (MAN) is a network that interconnects users with computer
resources in a geographic area or region larger than that covered by even a large local area
network (LAN) but smaller than the area covered by a wide area network (WAN). The term is
applied to the interconnection of networks in a city into a single larger network (which may then
also offer efficient connection to a wide area network). It is also used to mean the
Sreedevi Kadiyala Page 2
interconnection of several local area networks by bridging them with backbone lines. The latter
usage is also sometimes referred to as a campus network.

3. WAN(Wide Area Network):

• Wide Area Network (WAN) is a computer network that covers a broad area (i.e., any
network whose communications links cross metropolitan, regional, or national
boundaries). Or, less formally, a network that uses routers and public communications
links
• The largest and most well-known example of a WAN is the Internet.
• WANs are used to connect LANs and other types of networks together, so that users and
computers in one location can communicate with users and computers in other locations

III. Network topology:

A topology is a way of “laying out” the network. Topologies can be either physical or logical.
Physical topologies describe how the cables are run.
Logical topologies describe how the network messages travel
Types of Topologies
• Bus (can be both logical and physical)
• Star (physical only)
• Ring (can be both logical and physical)
• Mesh (can be both logical and physical)
• Hybrid

Bus Topology

It is difficult to add a workstation


have to completely reroute the cable and possibly run two additional lengths of it.
if any one of the cables breaks, the entire network is disrupted. Therefore, it is very
expensive to maintain.

Sreedevi Kadiyala Page 3


A bus is the simplest physical topology. It consists of a single cable that runs to every
workstation
This topology uses the least amount of cabling, but also covers the shortest amount of
distance.

2. STAR Topology
• Star topologies are easy to install. A cable is run from each workstation to the hub. The
hub is placed in a central location in the office.
• Star topologies are more expensive to install than bus networks, because there are several
more cables that need to be installed, plus the cost of the hubs that are needed.

3. Ring Topology:
• Each computer connects to two other computers, joining them in a circle creating a
unidirectional path where messages move workstation to workstation.
• Each entity participating in the ring reads a message, then regenerates it and hands it to
its neighbor on a different network cable.

Sreedevi Kadiyala Page 4


4. Mesh Topology:

• The mesh topology is the simplest logical topology in terms of data flow, but it is the
most complex in terms of physical design.
• In this physical topology, each device is connected to every other device
• This topology is rarely found in LANs, mainly because of the complexity of the cabling.
• If there are x computers, there will be (x × (x–1)) ÷ 2 cables in the network. For example,
if you have five computers in a mesh network, it will use 5 × (5 – 1) ÷ 2, which equals 10
cables. This complexity is compounded when you add another workstation.

5. Hybrid topology: A hybrid topology is a type of network topology that uses two or more
differing network topologies. These topologies can include a mix of bus topology,
mesh topology, ring topology, star topology, and tree topology

Sreedevi Kadiyala Page 5


Network Hardware:

• Switch:

– Split large networks into small segments, decreasing the number of users sharing
the same network resources and bandwidth.
– Understands when two devices want to talk to each other, and gives them a
switched connection
– Helps prevent data collisions and reduces network congestion, increasing network
performance.
– Most home users get very little, if any, advantage from switches, even when
sharing a broadband connection.
• Bridge
Resides on Layer 2 of the OSI model.
– Connects two LANs and forwards or filters data packets between them.
– Creates an extended network in which any two workstations on the linked LANs
can share data.
– Transparent to protocols and to higher level devices like routers.
– Forward data depending on the Hardware (MAC) address, not the Network
address (IP).
– Resides on Layer 2 of the OSI model.

• Repeater
– Used to boost the signal between two cable segments or wireless access points.
– Can not connect different network architecture.
– Does not simply amplify the signal, it regenerates the packets and retimes them.
Resides on Layer 1 of the OSI model
• Router
– A device that connects any number of LANs.
– Uses standardized protocols to move packets efficiently to their destination.
– More sophisticated than bridges, connecting networks of different types (for
example, star and token ring)
– Forwards data depending on the Network address (IP), not the Hardware (MAC)
address.
– Routers are the only one of these four devices that will allow you to share a single
IP address among multiple network clients.
– Resides on Layer 3 of the OSI model.
• Additional Network Hardware Devices
– Network Interface Cards (NICs)
• Puts the data into packets and transmits packet onto the network.
• May be wired or wireless.
– Gateway

Sreedevi Kadiyala Page 6


• Connects networks with different protocols like TCP/IP network and
IPX/SPX networks.
• Routers and Gateways often refer to the same device.
– Proxy server
• Isolates internal network computers from the internet.
• The user first access the proxy server and the proxy server accesses the
internet and retrieves the requested web page or document. The user then
gets a copy of that page from the proxy server.
– Broadcast networks: single communication channel shared by all machines
– multicasting: reserve one bit to indicate multicasting, the remaining n-1address
bits can hold a group number. Each machine can subscribe to any groups
• used by localized networks (or satellites)
• point-to-point networks: many hopsrouting algorithms: multiple routs are
possible used by large network

Network Software:

• Protocol Hierarchies (Layer structure)


• Design Issues for the Layers
• Connection-Oriented and Connectionless Services
• Service Primitives
• The Relationship of Services to Protocols
Protocol Hierarchies
– a series of layers (levels)
– lower layer provides service to higher layers
protocol: an agreement between the communication parties on how communication is to
proceed
– Peers: the corresponding layers on different machines.
– Network architecture: a set of layers and protocols
– Protocol stack: a list of protocols used by a certain system, one protocol per layer

Open Systems Interconnection Reference Model(ISO-OSI)

o OSI stands for Open System Interconnection is a reference model that describes how
information from a software application in one computer moves through a physical
medium to the software application in another computer.
o OSI consists of seven layers, and each layer performs a particular network function.
o OSI model was developed by the International Organization for Standardization (ISO) in
1984, and it is now considered as an architectural model for the inter-computer
communications.

Sreedevi Kadiyala Page 7


o OSI model divides the whole task into seven smaller and manageable tasks. Each layer is
assigned a particular task.
o Each layer is self-contained, so that task assigned to each layer can be performed
independently.

o The OSI model is divided into two layers: upper layers and lower layers.
o The upper layer of the OSI model mainly deals with the application related issues, and
they are implemented only in the software. The application layer is closest to the end
user. Both the end user and the application layer interact with the software applications.
An upper layer refers to the layer just above another layer.
o The lower layer of the OSI model deals with the data transport issues. The data link layer
and the physical layer are implemented in hardware and software. The physical layer is
the lowest layer of the OSI model and is closest to the physical medium. The physical
layer is mainly responsible for placing the information on the physical medium.

There are the seven OSI layers. Each layer has different functions. A list of seven layers are
given below:

1. Physical Layer
2. Data-Link Layer
3. Network Layer
4. Transport Layer
5. Session Layer
6. Presentation Layer
7. Application Layer
Sreedevi Kadiyala Page 8
OSI Model's 7 Layers
Application to Application
APPLICATION APPLICATION

Application to Application
PRESENTATION PRESENTATION

Application to Application
SESSION SESSION

TRANSPORT Process to Process TRANSPORT

NETWORK Source to Destination NETWORK


Router
Source to Destination

Hop to Hop
DATA LINK Switch DATA LINK
Hop to Hop

Hub and Repeater


PHYSICAL PHYSICAL
Physical Medium

29

Data Flow in OSI Model

When we transfer information from one device to another, it travels through 7 layers of OSI
model. First data travels down through 7 layers from the sender’s end and then climbs back 7
layers on the receiver’s end.

Data flows through the OSI model in a step-by-step process:

• Application Layer: Applications create the data.


• Presentation Layer: Data is formatted and encrypted.
• Session Layer: Connections are established and managed.
• Transport Layer: Data is broken into segments for reliable delivery.
• Network Layer: Segments are packaged into packets and routed.
• Data Link Layer: Packets are framed and sent to the next device.
• Physical Layer: Frames are converted into bits and transmitted physically.

Each layer adds specific information to ensure the data reaches its destination correctly, and
these steps are reversed upon arrival.

Sreedevi Kadiyala Page 9


Let’s look at it with an Example:
A sends an e-mail to his friend B
Step 1: A interacts with e-mail application like Gmail, outlook, etc. Writes his email to send.
(This happens in Layer 7: Application layer)

Step 2: Mail application prepares for data transmission like encrypting data and formatting it
for transmission. (This happens in Layer 6: Presentation Layer)

Step 3: There is a connection established between the sender and receiver on the internet.
(This happens in Layer 5: Session Layer)

Step 4: Email data is broken into smaller segments. It adds sequence number and error-
checking information to maintain the reliability of the information. (This happens in Layer 4:
Transport Layer)

Step 5: Addressing of packets is done in order to find the best route for transfer. (This
happens in Layer 3: Network Layer)

Step 6: Data packets are encapsulated into frames, then MAC address is added for local
devices and then it checks for error using error detection. (This happens in Layer 2: Data
Link Layer)

Step 7: Lastly Frames are transmitted in the form of electrical/ optical signals over a physical
network medium like ethernet cable or WiFi.

Sreedevi Kadiyala Page 10


Physical Layer – Layer 1

The lowest layer of the OSI reference model is the physical layer. It is responsible for the
actual physical connection between the devices. The physical layer contains information in the
form of bits. It is responsible for transmitting individual bits from one node to the next. When
receiving data, this layer will get the signal received and convert it into 0s and 1s and send
them to the Data Link layer, which will put the frame back together.

Functions of the Physical Layer

• Bit Synchronization: The physical layer provides the synchronization of the bits by
providing a clock. This clock controls both sender and receiver thus providing
synchronization at the bit level.
• Bit Rate Control: The Physical layer also defines the transmission rate i.e. the number of
bits sent per second.
• Physical Topologies: Physical layer specifies how the different, devices/nodes are
arranged in a network i.e. bus, star, or mesh topology.
• Transmission Mode: Physical layer also defines how the data flows between the two
connected devices. The various transmission modes possible are Simplex, half-duplex and
full-duplex.

Note:
• Hub, Repeater, Modem, and Cables are Physical Layer devices.
• Network Layer, Data Link Layer, and Physical Layer are also known as Lower
Layers or Hardware Layers.

Data Link Layer (DLL) – Layer 2

The data link layer is responsible for the node-to-node delivery of the message. The main
function of this layer is to make sure data transfer is error-free from one node to another, over
the physical layer. When a packet arrives in a network, it is the responsibility of the DLL to
transmit it to the Host using its MAC address.

The Data Link Layer is divided into two sublayers:

• Logical Link Control (LLC)


• Media Access Control (MAC)

The packet received from the Network layer is further divided into frames depending on the
frame size of the NIC(Network Interface Card). DLL also encapsulates Sender and Receiver’s
MAC address in the header.

Sreedevi Kadiyala Page 11


The Receiver’s MAC address is obtained by placing an ARP(Address Resolution
Protocol) request onto the wire asking “Who has that IP address?” and the destination host
will reply with its MAC address.

Functions of the Data Link Layer

• Framing: Framing is a function of the data link layer. It provides a way for a sender to
transmit a set of bits that are meaningful to the receiver. This can be accomplished by
attaching special bit patterns to the beginning and end of the frame.
• Physical Addressing: After creating frames, the Data link layer adds physical addresses
(MAC addresses) of the sender and/or receiver in the header of each frame.
• Error Control: The data link layer provides the mechanism of error control in which it
detects and retransmits damaged or lost frames.
• Flow Control: The data rate must be constant on both sides else the data may get corrupted
thus, flow control coordinates the amount of data that can be sent before receiving an
acknowledgment.
• Access Control: When a single communication channel is shared by multiple devices, the
MAC sub-layer of the data link layer helps to determine which device has control over the
channel at a given time.

Note:
• Packet in the Data Link layer is referred to as Frame.
• Data Link layer is handled by the NIC (Network Interface Card) and device drivers of host
machines.
• Switch & Bridge are Data Link Layer devices.

Network Layer – Layer 3

The network layer works for the transmission of data from one host to the other located in
different networks. It also takes care of packet routing i.e. selection of the shortest path to

Sreedevi Kadiyala Page 12


transmit the packet, from the number of routes available. The sender & receiver’s IP addresses
are placed in the header by the network layer.
Functions of the Network Layer

• Routing: The network layer protocols determine which route is suitable from source to
destination. This function of the network layer is known as routing.
• Logical Addressing: To identify each device inter-network uniquely, the network layer
defines an addressing scheme. The sender & receiver’s IP addresses are placed in the
header by the network layer. Such an address distinguishes each device uniquely and
universally.

Note:
• Segment in the Network layer is referred to as Packet.
• Network layer is implemented by networking devices such as routers and switches.

Transport Layer – Layer 4

The transport layer provides services to the application layer and takes services from the
network layer. The data in the transport layer is referred to as Segments. It is responsible for
the end-to-end delivery of the complete message. The transport layer also provides the
acknowledgment of the successful data transmission and re-transmits the data if an error is
found.

At the sender’s side: The transport layer receives the formatted data from the upper layers,
performs Segmentation, and also implements Flow and error control to ensure proper data
transmission. It also adds Source and Destination port numbers in its header and forwards the
segmented data to the Network Layer.

Note: The sender needs to know the port number associated with the receiver’s application.
Generally, this destination port number is configured, either by default or manually. For
example, when a web application requests a web server, it typically uses port number 80,
because this is the default port assigned to web applications. Many applications have default
ports assigned.

At the receiver’s side: Transport Layer reads the port number from its header and forwards
the Data which it has received to the respective application. It also performs sequencing and
reassembling of the segmented data.

Functions of the Transport Layer

• Segmentation and Reassembly: This layer accepts the message from the (session) layer,
and breaks the message into smaller units. Each of the segments produced has a header
associated with it. The transport layer at the destination station reassembles the message.
• Service Point Addressing: To deliver the message to the correct process, the transport
layer header includes a type of address called service point address or port address. Thus by
specifying this address, the transport layer makes sure that the message is delivered to the
correct process.
Sreedevi Kadiyala Page 13
Services Provided by Transport Layer
• Connection-Oriented Service
• Connectionless Service

1. Connection-Oriented Service: It is a three-phase process that includes:


• Connection Establishment
• Data Transfer
• Termination/disconnection

In this type of transmission, the receiving device sends an acknowledgment, back to the
source after a packet or group of packets is received. This type of transmission is reliable and
secure.

2. Connectionless service: It is a one-phase process and includes Data Transfer. In this type
of transmission, the receiver does not acknowledge receipt of a packet. This approach allows
for much faster communication between devices. Connection-oriented service is more reliable
than connectionless Service.

Note:

• Data in the Transport Layer is called Segments.


• Transport layer is operated by the Operating System. It is a part of the OS and
communicates with the Application Layer by making system calls.
• The transport layer is called as Heart of the OSI model.
• Device or Protocol Use : TCP, UDP NetBIOS, PPTP

Session Layer – Layer 5

This layer is responsible for the establishment of connection, maintenance of sessions, and
authentication, and also ensures security.
Functions of the Session Layer

• Session Establishment, Maintenance, and Termination: The layer allows the two
processes to establish, use, and terminate a connection.
• Synchronization: This layer allows a process to add checkpoints that are considered
synchronization points in the data. These synchronization points help to identify the error
so that the data is re-synchronized properly, and ends of the messages are not cut
prematurely and data loss is avoided.
• Dialog Controller: The session layer allows two systems to start communication with each
other in half-duplex or full-duplex.

Note:
• All the below 3 layers(including Session Layer) are integrated as a single layer in
the TCP/IP model as the “Application Layer”.
• Implementation of these 3 layers is done by the network application itself. These are also
known as Upper Layers or Software Layers.
• Device or Protocol Use : NetBIOS, PPTP.

Sreedevi Kadiyala Page 14


Example

Let us consider a scenario where a user wants to send a message through some Messenger
application running in their browser. The “Messenger” here acts as the application layer
which provides the user with an interface to create the data. This message or so-called Data is
compressed, optionally encrypted (if the data is sensitive), and converted into bits (0’s and
1’s) so that it can be transmitted.

Communication in Session Layer

Presentation Layer – Layer 6

The presentation layer is also called the Translation layer. The data from the application
layer is extracted here and manipulated as per the required format to transmit over the
network.

Functions of the Presentation Layer

• Translation: For example, ASCII to EBCDIC.


• Encryption/ Decryption: Data encryption translates the data into another form or code.
The encrypted data is known as the ciphertext and the decrypted data is known as plain
text. A key value is used for encrypting as well as decrypting data.
• Compression: Reduces the number of bits that need to be transmitted on the network.

Note: Device or Protocol Use: JPEG, MPEG, GIF.

Application Layer – Layer 7

At the very top of the OSI Reference Model stack of layers, we find the Application layer
which is implemented by the network applications. These applications produce the data to be
transferred over the network. This layer also serves as a window for the application services to
access the network and for displaying the received information to the user.

Example: Application – Browsers, Skype Messenger, etc.


Note: The application Layer is also called Desktop Layer.
Device or Protocol Use : SMTP.
Functions of the Application Layer
The main functions of the application layer are given below.
• Network Virtual Terminal(NVT): It allows a user to log on to a remote host.

Sreedevi Kadiyala Page 15


• File Transfer Access and Management(FTAM): This application allows a user to
access files in a remote host, retrieve files in a remote host, and manage or
control files from a remote computer.
• Mail Services: Provide email service.
• Directory Services: This application provides distributed database sources
and access for global information about various objects and services.
Note: The OSI model acts as a reference model and is not implemented on the Internet
because of its late invention. The current model being used is the TCP/IP model.

Introduction TCP/IP

o The TCP/IP model was developed prior to the OSI model.


o The TCP/IP model is not exactly similar to the OSI model.
o The TCP/IP model consists of five layers: the application layer, transport layer, network
layer, data link layer and physical layer.
o The first four layers provide physical standards, network interface, internetworking, and
transport functions that correspond to the first four layers of the OSI model and these
four layers are represented in TCP/IP model by a single layer called the application layer.
o TCP/IP is a hierarchical protocol made up of interactive modules, and each of them
provides specific functionality.

The Internet Protocol Suite (commonly known as TCP/IP) is the set of communications
protocols used for the Internet and other similar networks.

It is named from two of the most important protocols in it:

APPLICATION Layer: This layer also contains the high level protocols. The main issue
with this layer is the ability to use both TCP and UDP protocols.

TRANSPORT Layer: This layer acts as the delivery service used by the application layer.
Sreedevi Kadiyala Page 16
Again the two protocols used are TCP and UDP.
The choice is made based on the application's transmission reliability requirements.
The transport layer also handles all error detection and recovery.
INTERNET Layer: This layer is also known as Internet layer. The main purpose of this
layer is to organize or handle the movement of data on network.

Physical &Data link Layer: This layer is also known as network interface layer
This layer normally consists of device drivers in the OS and the network interface card
attached to the system.

Both the device drivers and the network interface card take care of the communication
details with the media being used to transfer the data over the network

Difference Between TCP and IP


TCP (Transmission Control
Feature Protocol) IP (Internet Protocol)

Ensures reliable, ordered, and


Provides addressing and routing
Purpose error-checked delivery of data
of packets across networks.
between applications.

Type Connection-oriented Connectionless

Manages data transmission Routes packets of data from the


Function between devices, ensuring data source to the destination based
integrity and order. on IP addresses.

No, IP itself does not handle


Yes, includes error checking and
Error Handling errors; relies on upper-layer
recovery mechanisms.
protocols like TCP.

Yes, includes flow control


Flow Control No
mechanisms.

Yes, manages network


Congestion Control No
congestion.

Breaks data into smaller packets


Breaks data into packets but
Data Segmentation and reassembles them at the
does not handle reassembly.
destination.

Header Size Larger, 20-60 bytes Smaller, typically 20 bytes

Does not guarantee delivery,


Reliability Provides reliable data transfer
reliability, or order.

Sreedevi Kadiyala Page 17


TCP (Transmission Control
Feature Protocol) IP (Internet Protocol)

Transmission Yes, acknowledges receipt of


No
Acknowledgment data packets.

PHYSICAL LAYER:

Classes of transmission media

Types Of Guided Media

• Guided media, which are those that provide a conduit from one device to another,
include twisted-pair cable, coaxial cable, and fiber- optic cable.
• Twisted pair cable: Consists of two insulated copper wires arranged in a regular spiral
pattern to minimize the electromagnetic interference between adjacent pairs
• Often used at customer facilities and also over distances to carry voice as well as data
communications
Low frequency transmission medium

Types of twisted-pair cable

• STP (shielded twisted pair)


– the pair is wrapped with metallic foil or braid to insulate the pair from
electromagnetic interference
• UTP (unshielded twisted pair)
– each wire is insulated with plastic wrap, but the pair is encased in an outer
covering
Twisted Pair Advantages:
Sreedevi Kadiyala Page 18
• Inexpensive and readily available
• Flexible and light weight
• Easy to work with and install
Coaxial Cable (or Coax):

• Used for cable television, LANs, telephony


• Has an inner conductor surrounded by a braided mesh
• Both conductors share a common center axial, hence the term “co-axial”

• Higher bandwidth
– 400 to 600Mhz
– up to 10,800 voice conversations
• Can be tapped easily (pros and cons)
• Much less susceptible to interference than twisted pair

Fiber Optic Cable: Relatively new transmission medium used by telephone companies
in place of long-distance trunk lines

• Also used by private companies in implementing local data communications networks


• Require a light source with injection laser diode (ILD) or light-emitting diodes (LED)

Fiber Optic Disadvantages:

• expensive over short distance


• requires highly skilled installers
• adding additional nodes is difficult

Sreedevi Kadiyala Page 19


Wireless (Unguided Media) Transmission:

Wireless transmission divided into three groups


Radio waves
Micro waves
Infrared
Radio waves
• radio is omni-directional and microwave is directional
• Radio is a general term often used to encompass frequencies in the range 3 kHz to 300
GHz.
• Mobile telephony occupies several frequency bands just under 1 GHz.
MICROWAVES:
Microwaves are used for unicast communication such as cellular telephones,
satellite networks, and wireless LANs
Higher frequency ranges cannot penetrate walls
Use directional antennas - point to point line of sight communications
1 and 300 GHz
Infrared
• Uses transmitters/receivers (transceivers) that modulate noncoherent infrared light.
• Transceivers must be within line of sight of each other (directly or via reflection ).
• Unlike microwaves, infrared does not penetrate walls.
• 300 GHz to 400 THz

EXAMPLES:

Intranet: An intranet is a private network that is contained within an enterprise. It may consist
of many interlinked local area networks and also use leased lines in the wide area network.
An intranet uses TCP/IP,HTTP, and other Internet protocols and in general looks like a private
version of the Internet. With tunnenling, companies can send private messages through the
public network, using the public network with special encryption/decryption and other security
safeguards to connect one part of their intranet to another.

Internet: is a worldwide system of computer networks - a network of networks in which users


at any one computer can, if they have permission, get information from any other computer (and
sometimes talk directly to users at other computers).

Sreedevi Kadiyala Page 20


ARPANET:

• In the mid-1960s, mainframe computers in research organizations were stand-alone


devices. Computers from different manufacturers were unable to communicate with one
another. The Advanced Research Projects Agency (ARPA) in the Department of Defense
(DOD) was interested in finding a way to connect computers so that the researchers they
funded could share their findings, thereby reducing costs and eliminating duplication of
effort. In 1967, at an Association for Computing Machinery (ACM) meeting, ARPA
presented its ideas for the 4 universities University of California, Stanford
Research Institute ,University of Utah ,University of Stanta Berbarabara

Advanced Research Projects Agency Network (ARPANET), a small network of connected


computers. The idea was that each host computer (not necessarily from the same
manufacturer) would be attached to a specialized computer, called an interface message
processor (IMP). The IMPs, in turn, would be connected to each other. Each IMP had to be
able to communicate with other IMPs as well as with its own attached host.

Data Link Layer:

The data link layer is the second layer from the bottom in the OSI (Open System
Interconnection) network architecture model. It is responsible for the node-to-node delivery of
data. Its major role is to ensure error-free transmission of information. DLL is also responsible
for encoding, decoding, and organizing the outgoing and incoming data.
This is considered the most complex layer of the OSI model as it hides all the underlying
complexities of the hardware from the other above layers. In this article, we will discuss Data
Link Layer in Detail along with its functions, and sub-layers.

Sub-Layers of The Data Link Layer

The data link layer is further divided into two sub-layers, which are as follows:

Sreedevi Kadiyala Page 21


Logical Link Control (LLC)
This sublayer of the data link layer deals with multiplexing, the flow of data among
applications and other services, and LLC is responsible for providing error messages and
acknowledgments as well.

Media Access Control (MAC)


MAC sublayer manages the device’s interaction, responsible for addressing frames, and also
controls physical media access.
The data link layer receives the information in the form of packets from the Network layer, it
divides packets into frames and sends those frames bit-by-bit to the underlying physical layer.

Functions of The Data-link Layer


There are various benefits of data link layers s let’s look into it.

Framing:

The packet received from the Network layer is known as a frame in the Data link layer. At the
sender’s side, DLL receives packets from the Network layer and divides them into small
frames, then, sends each frame bit-by-bit to the physical layer. It also attaches some special
bits (for error control and addressing) at the header and end of the frame. At the receiver’s
end, DLL takes bits from the Physical layer organizes them into the frame, and sends them to
the Network layer.

Addressing
The data link layer encapsulates the source and destination’s MAC address/ physical address
in the header of each frame to ensure node-to-node delivery. MAC address is the unique
hardware address that is assigned to the device while manufacturing.

Sreedevi Kadiyala Page 22


Error Control
Data can get corrupted due to various reasons like noise, attenuation, etc. So, it is the
responsibility of the data link layer, to detect the error in the transmitted data and correct it
using error detection and correction techniques respectively. DLL adds error detection bits
into the frame’s header, so that receiver can check received data is correct or not. It adds
reliability to phyiscal layer by adding mechansims to detect and retransmit damaged or lost
frames.

Flow Control
If the receiver’s receiving speed is lower than the sender’s sending speed, then this can lead to
an overflow in the receiver’s buffer and some frames may get lost. So, it’s the responsibility
of DLL to synchronize the sender’s and receiver’s speeds and establish flow control between
them.

Access Control
When multiple devices share the same communication channel there is a high probability of
collision, so it’s the responsibility of DLL to check which device has control over the channel
and CSMA/CD and CSMA/CA can be used to avoid collisions and loss of frames in the
channel.

Framing

The data link layer encapsulates each data packet from the network layer into frames that are
then transmitted.

A frame has three parts, namely −

• Frame Header
• Payload field that contains the data packet from network layer
• Trailer

Sreedevi Kadiyala Page 23


Error Detection and Correction

Data-link layer uses error control techniques to ensure that frames, i.e. bit streams of data, are
transmitted from the source to the destination with a certain extent of accuracy.

Errors

When bits are transmitted over the computer network, they are subject to get corrupted due to
interference and network problems. The corrupted bits leads to spurious data being received by
the destination and are called errors.

Types of Errors

Errors can be of three types, namely single bit errors, multiple bit errors, and burst errors.

• Single bit error − In the received frame, only one bit has been corrupted, i.e. either
changed from 0 to 1 or from 1 to 0.

• Multiple bits error − In the received frame, more than one bits are corrupted.

• Burst error − In the received frame, more than one consecutive bits are corrupted.

Sreedevi Kadiyala Page 24


Error Control

Error control can be done in two ways

• Error detection − Error detection involves checking whether any error has occurred or
not. The number of error bits and the type of error does not matter.
• Error correction − Error correction involves ascertaining the exact number of bits that
has been corrupted and the location of the corrupted bits.

For both error detection and error correction, the sender needs to send some additional bits
along with the data bits. The receiver performs necessary checks based upon the additional
redundant bits. If it finds that the data is free from errors, it removes the redundant bits before
passing the message to the upper layers.

Error Detection Techniques

There are three main techniques for detecting errors in frames: Parity Check, Checksum,
and Cyclic Redundancy Check (CRC).

Parity Check

The parity check is done by adding an extra bit, called parity bit to the data to make a number of
1s either even in case of even parity or odd in case of odd parity.

While creating a frame, the sender counts the number of 1s in it and adds the parity bit in the
following way

• In case of even parity: If a number of 1s is even then parity bit value is 0. If the number
of 1s is odd then parity bit value is 1.
• In case of odd parity: If a number of 1s is odd then parity bit value is 0. If a number of 1s
is even then parity bit value is 1.

On receiving a frame, the receiver counts the number of 1s in it. In case of even parity check, if
the count of 1s is even, the frame is accepted, otherwise, it is rejected

The parity check is suitable for single bit error detection only.

Checksum

In this error detection scheme, the following procedure is applied

• Data is divided into fixed sized frames or segments.


• The sender adds the segments using 1’s complement arithmetic to get the sum. It then
complements the sum to get the checksum and sends it along with the data frames.
• The receiver adds the incoming segments along with the checksum using 1’s
complement arithmetic to get the sum and then complements it.
• If the result is zero, the received frames are accepted; otherwise, they are discarded.

Sreedevi Kadiyala Page 25


Cyclic Redundancy Check (CRC)

Cyclic Redundancy Check (CRC) involves binary division of the data bits being sent by a
predetermined divisor agreed upon by the communicating system. The divisor is generated
using polynomials.

• Here, the sender performs binary division of the data segment by the divisor. It then
appends the remainder called CRC bits to the end of the data segment. This makes the
resulting data unit exactly divisible by the divisor.
• The receiver divides the incoming data unit by the divisor. If there is no remainder, the
data unit is assumed to be correct and is accepted. Otherwise, it is understood that the
data is corrupted and is therefore rejected.

Error Correction Techniques

Error correction techniques find out the exact number of bits that have been corrupted and as
well as their locations. There are two principle ways

• Backward Error Correction (Retransmission) − If the receiver detects an error in the


incoming frame, it requests the sender to retransmit the frame. It is a relatively simple
technique. But it can be efficiently used only where retransmitting is not expensive as in
fiber optics and the time for retransmission is low relative to the requirements of the
application.
• Forward Error Correction − If the receiver detects some error in the incoming frame,
it executes error-correcting code that generates the actual frame. This saves bandwidth
required for retransmission. It is inevitable in real-time systems. However, if there are
too many errors, the frames need to be retransmitted.

* * *

Sreedevi Kadiyala Page 26

You might also like