[go: up one dir, main page]

0% found this document useful (0 votes)
5 views39 pages

CN Unit-1 Lecture Notes

The document contains lecture notes for the Computer Networks course at Guru Nanak Institutions Technical Campus for the academic year 2024-2025. It covers fundamental concepts such as network definitions, advantages and disadvantages of networking, types of networks (LAN, MAN, WAN), network topologies, and the OSI model. The notes serve as a comprehensive guide for B.Tech students in the Computer Science and Engineering department.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views39 pages

CN Unit-1 Lecture Notes

The document contains lecture notes for the Computer Networks course at Guru Nanak Institutions Technical Campus for the academic year 2024-2025. It covers fundamental concepts such as network definitions, advantages and disadvantages of networking, types of networks (LAN, MAN, WAN), network topologies, and the OSI model. The notes serve as a comprehensive guide for B.Tech students in the Computer Science and Engineering department.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 39

GURU NANAK INSTITUTIONS TECHNICAL CAMPUS (AUTONOMOUS)

SCHOOL OF ENGINEERING & TECHNOLOGY

LECTURE NOTES

COMPUTER NETWORKS

SUBJECT CODE: 22PC0CS14

B.TECH III Year-I Semester

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING AY: 2024-2025

B. TECH – COMPUTER SCINCE AND ENGINEERING – GNITC (SPECIAL BATCH)


GURU NANAK INSTITUTIONS TECHNICAL CAMPUS (AUTONOMOUS)
SCHOOL OF ENGINEERING & TECHNOLOGY

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING


LECTURE NOTES FOR THE ACADEMIC YEAR 2024-25

FACULTY NAME :

SUBJECT : COMPUTER NETWORKS

SUBJECT CODE : 22PC0CS14

YEAR III

SEMESTER I

STREAM : CSE

VERIFIED BY HOD – SPECIAL BATCH

Prepared by Dept.of CSE(SB) Page 1


GURU NANAK INSTITUTIONS TECHNICAL CAMPUS (AUTONOMOUS)
SCHOOL OF ENGINEERING & TECHNOLOGY

UNIT-I
Computer Networks

Network hardware, Network software, OSI, TCP/IP Reference models, Example Networks:
Internet, ARPANET. Physical Layer: Guided Transmission media: twisted pairs, coaxial
cable, Power lines, fiber optics. Wireless transmission: Electromagnetic spectrum, Radio
transmission, Microwave transmission, Infrared transmission, and Light transmission

1.1 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.
1.1.1Advantages of Networking
• Connectivity and Communication
• Data Sharing
• Hardware Sharing
• Internet Access
• Internet Access Sharing
• Data Security and Management
• Performance Enhancement and Balancing
• Entertainment
1.1.2 The Disadvantages (Costs) of Networking
• Network Hardware, Software and Setup Costs
• Hardware and Software Management and Administration Costs
• Undesirable Sharing
• Illegal or Undesirable Behavior
• Data Security Concerns

1.3 ARPANET:

Prepared by Dept.of CSE(SB) Page 2


GURU NANAK INSTITUTIONS TECHNICAL CAMPUS (AUTONOMOUS)
SCHOOL OF ENGINEERING & TECHNOLOGY

• 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.
1.4 Network Classifications Types:
1. LAN (Local Area Network)
2. MAN (Metropolitan Area Network)
3.WAN(Wide Area Network)

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

Prepared by Dept.of CSE(SB) Page 3


GURU NANAK INSTITUTIONS TECHNICAL CAMPUS (AUTONOMOUS)
SCHOOL OF ENGINEERING & TECHNOLOGY

– 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
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

Prepared by Dept.of CSE(SB) Page 4


GURU NANAK INSTITUTIONS TECHNICAL CAMPUS (AUTONOMOUS)
SCHOOL OF ENGINEERING & TECHNOLOGY

1.5. 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).

1.6. Network topology


A topology is a way of “laying out” the network. Topologies can be either physicalor
logical.Physical topologies describe how the cables are run.
Logical topologies describe how the network messages travelTypes 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 Toplogy
it is difficult to add a workstation
have to completely reroute the cable and possibly run two additional lengths ofit.
if any one of the cables breaks, the entire network is disrupted. Therefore, it isvery
expensive to maintain.

Prepared by Dept.of CSE(SB) Page 5


GURU NANAK INSTITUTIONS TECHNICAL CAMPUS (AUTONOMOUS)
SCHOOL OF ENGINEERING & TECHNOLOGY

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

2. STAR Topology
• Star topologies are easy to install. A cable is run from each workstation tothe 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.

Prepared by Dept.of CSE(SB) Page 6


GURU NANAK INSTITUTIONS TECHNICAL CAMPUS (AUTONOMOUS)
SCHOOL OF ENGINEERING & TECHNOLOGY

4. Mesh Toplogy:
• The mesh topology is the simplest logical topology in terms of data flow, butit 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 ofthe 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

Prepared by Dept.of CSE(SB) Page 7


GURU NANAK INSTITUTIONS TECHNICAL CAMPUS (AUTONOMOUS)
SCHOOL OF ENGINEERING & TECHNOLOGY

1.7. Open Systems Interconnection Reference Model(ISO-OSI)

• Open Systems Interconnection Basic Reference Model is an abstract description for


layered communications and computer network protocol design. It was developed as part
of the Open Systems Interconnection (OSI) initiative. In its most basic form, it divides
network architecture into seven layers which, from top to bottom, are the Application,
Presentation, Session, Transport, Network, Data-Link, and Physical Layers. It is therefore
often referred to as the OSI Seven Layer Model.

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

Source to Destination
Router
Source to Destination

Hop to Hop
Switch
Hop to Hop

Hub and Repeater


PHYSICAL PHYSICAL
Physical Medium

Prepared by Dept.of CSE(SB) Page 8


GURU NANAK INSTITUTIONS TECHNICAL CAMPUS (AUTONOMOUS)
SCHOOL OF ENGINEERING & TECHNOLOGY
NETWORK NETWORK

DATA LINK DATA LINK

29

Prepared by Dept.of CSE(SB) Page 9


GURU NANAK INSTITUTIONS TECHNICAL CAMPUS (AUTONOMOUS)
SCHOOL OF ENGINEERING & TECHNOLOGY

Data, Protocol & Activities


OSI Layers TCP/IP Suit Activities

Applica Application
Telnet, FTP, SMTP, To allow access to
tion
HTTP, DNS, SNMP, network resources
Specific address etc…

Presen Presentation To Translate,


tation encrypt, and
compress data

Sessio Session To establish,


n manage,
and
terminate
session

Transp Transport To Provide reliable


ort SCTP, TCP, UDP, process-to-process
Sockets and Ports Message delivery
address and error recovery

Networ Network To move packets


k IP, ARP/RARP, ICMP, from source to
IGMP, Logical address destination; to
provide
internetworking

Data Data Link To organize bits


Link IEEE 802 Standards, into frames; to
TR, FDDI, PPP, provide
Physical address Hop-to-hop
delivery

Physic Physical To Transmit bits over


al Medium, Coax, Fiber, a medium; to
10base, Wireless provide Mechanical
and electrical
specifications
30

Prepared by Dept.of CSE(SB) Page 10


GURU NANAK INSTITUTIONS TECHNICAL CAMPUS (AUTONOMOUS)
SCHOOL OF ENGINEERING & TECHNOLOGY

Physical Layer
From data link layer To data link layer

Physical layer
110 10101000000010 111 110 10101000000010111 Physical layer

Transmission medium

 One of the major function of the physical layer is to move data in the form of electromagnetic signals across a
transmission medium.
 Its responsible for movements of individual bits from one hop (Node) to next. Both data and the signals can be
 either analog or digital.
 Transmission media work by conducting energy along a physical path which can be wired or wireless

 Concerned:
 Physical characteristics of interface and medium (Transmission medium)
 Representation of bits (stream of bits (0s or 1s) with no interpretation and encoded into signals) Data
 rate (duration of a bit, which is how long it last)
 Synchronization of bits (sender and receivers clock must be synchronized) Line configuration (Point-to-
 Point, Point-to-Multipoint)
 Physical topology
 Transmission mode (Simplex, half duplex, full duplex)

Prepared by Dept.of CSE(SB) Page 11


GURU NANAK INSTITUTIONS TECHNICAL CAMPUS (AUTONOMOUS)
SCHOOL OF ENGINEERING & TECHNOLOGY

Data Link Layer (Host to Host)


From network layer To network layer

Data link layer H2 Data T2 H2 Data T2 Data link layer

To physical layer From physical layer

 Data link layer is responsible for moving frames from one hop (Node) to the next.

 Concerned:


Framing (stream of bits into manageable data units) Physical
 addressing (MAC Address)


Flow Control (mechanism for overwhelming the receiver) Error
Control (trailer, retransmission)
Access Control (defining master device in the same link)
32

Network Layer (Source to Destination)

From transport layer To transport layer

Network layer H3 Data Packet H3 Data Packet Network layer

To data link layer From data link layer

 The network layer is responsible for the delivery of individual packets from the source host to
the destination host.

 Concerned:


Logica l a ddressing (IP Address)
Routing (Source to destination transmission betweennetworks)

33

Prepared by Dept.of CSE(SB) Page 12


GURU NANAK INSTITUTIONS TECHNICAL CAMPUS (AUTONOMOUS)
SCHOOL OF ENGINEERING & TECHNOLOGY

Transport Layer (Process to Process)


From session layer From session layer

Transport layer H4 Data H4 Data H4 Data Transport layer

H
4 D H D H
4 D
a 4 at
at at
Segments Segments

a a
To network layer From network layer
 The transport layer is responsible for the delivery of a message from one process to another

Concerned:
 •Service-point addressing (Port address)
• .Segmentation and reassembly (Sequence umber)
• Connection control (Connectionless or connection oriented) Flow control
(end to end)
• Error Control (Process to Process)

Session Layer (Dialog initiation)


From Presentation layer To Presentation layer

H5 Data Data Data H5 Data Data Data Session layer


Session layer
Syn Syn Syn Syn Syn Syn

To transport layer From transport layer

 The session layer is responsible for dialog control and synchronization

 Concerned:

•Dialog Control (Half Duplex/Full duplex)
• Synchronization (Synchronization points, process
inline within same page)
35

Prepared by Dept.of CSE(SB) Page 13


GURU NANAK INSTITUTIONS TECHNICAL CAMPUS (AUTONOMOUS)
SCHOOL OF ENGINEERING & TECHNOLOGY

Presentation Layer (dependency)


From application layer To application layer

presentation layer H6 Data


H6 Data presentation layer

To session layer From session layer

 The presentation layer is responsible f or translation, compression and encryption

 Concerned:
• Translation (interoperability between different encoding system)
Encryption (Privacy schemes)
• Compression (data compression)

Application Layer (user level service)


USER USER
(Human or Program) (Human or Program)

X.500 FTAM X.400


X.500 FTAM X.400

Application layer

Application layer

H7 Data Message H7 Data Message

To presentation layer
From presentation layer

 The application layer is responsible f or prov iding serv ices to the user.

 Concerned:
 Network virtual terminal (Software) File transfer, access and management Mail services
 Directory services (access to distributed database sources for global information about various objects
 and services)

37

1.8. Introduction TCP/IP


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:

Prepared by Dept.of CSE(SB) Page 14


GURU NANAK INSTITUTIONS TECHNICAL CAMPUS (AUTONOMOUS)
SCHOOL OF ENGINEERING & TECHNOLOGY

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.
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

1.9. Classes of transmission media

Prepared by Dept.of CSE(SB) Page 15


GURU NANAK INSTITUTIONS TECHNICAL CAMPUS (AUTONOMOUS)
SCHOOL OF ENGINEERING & TECHNOLOGY

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:
• 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)

Prepared by Dept.of CSE(SB) Page 16


GURU NANAK INSTITUTIONS TECHNICAL CAMPUS (AUTONOMOUS)
SCHOOL OF ENGINEERING & TECHNOLOGY

• 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
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 ).

Prepared by Dept.of CSE(SB) Page 17


GURU NANAK INSTITUTIONS TECHNICAL CAMPUS (AUTONOMOUS)
SCHOOL OF ENGINEERING & TECHNOLOGY

• Unlike microwaves, infrared does not penetrate walls.


• 300 GHz to 400 THz

1.10 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

Prepared by Dept.of CSE(SB) Page 18


GURU NANAK INSTITUTIONS TECHNICAL CAMPUS (AUTONOMOUS)
SCHOOL OF ENGINEERING & TECHNOLOGY

– Network Interface Cards (NICs)


• Puts the data into packets and transmits packet onto the network.
• May be wired or wireless.
– Gateway
• Connects networks with different protocols like TCP/IP
network andIPX/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
1.11 Network Software:

• Protocol Hierarchies (Layer structure)


• Design Issues for the Layers
• Connection-Oriented and Connectionless Services
• Service Primitives
• The Relationship of Services to
ProtocolsProtocol Hierarchies
– a series of layers (levels)
– lower layer provides service to higher layers
protocol: an agreement between the communication parties on how
communication is toproceed
– 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

Prepared by Dept.of CSE(SB) Page 19


GURU NANAK INSTITUTIONS TECHNICAL CAMPUS (AUTONOMOUS)
SCHOOL OF ENGINEERING & TECHNOLOGY

Example Networks
Internet
ARPANET
NSFNET
Third-generation mobile phone networks
Wireless LANs: 802.11
RFID and sensor networks

Example Networks
Internet
The Internet is not really a network at all, but a vast collection of different networks that use certain
common protocols and provide certain common services.
It is an unusual system in that it was not planned by anyone and is not controlled by anyone.
Architecture of the Internet

Prepared by Dept.of CSE(SB) Page 20


GURU NANAK INSTITUTIONS TECHNICAL CAMPUS (AUTONOMOUS)
SCHOOL OF ENGINEERING & TECHNOLOGY

Example Networks
Internet
Architecture of the Internet
To join the Internet, the computer is connected to an Internet Service Provider, or simply ISP, from
who the user purchases Internet access or connectivity.
A common way to connect to an ISP is to use the phone line to your house, in which case your phone
company is your ISP.
DSL, short for Digital Subscriber Line, reuses the telephone line that connects to your house for
digital data transmission.
The computer is connected to a device called a DSL modem that converts between digital packets
and analog signals that can pass unhindered over the telephone line.
At the other end, a device called a DSLAM (Digital Subscriber Line Access Multiplexer) converts
between signals and packets.

ARPANET
ARPANET stands for Advanced Research Projects Agency NET.
ARPANET was the first network which consisted of distributed control.
It was the first to implement TCP/IP protocols.
It was basically the beginning of the Internet with the use of these technologies.
It was designed with a basic idea in mind that was to communicate with scientific users among an
institute or university.
History of ARPANET :
ARPANET was introduced in the year 1969 by the Advanced Research Projects Agency (ARPA) of
US Department of Defense.
It was established using a bunch of PCs at various colleges and sharing of information and messages
was done.
It was for playing as long separation diversions and individuals were asked to share their perspectives.
In the year 1980, ARPANET was handed over to a different military network, Defense Data Network.

Characteristics of ARPANET :
Example Networks
ARPANET
It is basically a type of WAN.
It used the concept of Packet Switching Network.
It used Interface Message Processors(IMPs) for sub-netting.
ARPANETs software was split into two parts- a host and a subnet.

Prepared by Dept.of CSE(SB) Page 21


GURU NANAK INSTITUTIONS TECHNICAL CAMPUS (AUTONOMOUS)
SCHOOL OF ENGINEERING & TECHNOLOGY

Advantages of ARPANET :
ARPANET was designed to service even in a Nuclear Attack.
It was used for collaborations through E-mails.
It created advancement in the transfer of important files and data of defense.
Limitations of ARPANET :
Increased number of LAN connections resulted in difficulty handling.
It was unable to cope-up with advancements in technology.

DATA LINK LAYER FUNCTIONS (SERVICES)

1) Providing services to the network layer


Unacknowledged connectionless service.

Appropriate for low error rate and real-time traffic. Ex: Ethernet
Acknowledged connectionless service.

Useful in unreliable channels, Wi-Fi. Ack/Timer/Resend Acknowledged


connection-oriented service.
Guarantee frames are received exactly once and in the right order. Appropriate
over long, unreliable links such as a satellite channel or a long- distance
telephone circuit
2) Framing: Frames are the streams of bits received from the network layerinto
manageable data units. This division of stream of bits is done by DataLink Layer.
Physical Addressing: The Data Link layer adds a header to the frame in order
to define physical address of the sender or receiver of the frame, if the frames
are to be distributed to different systems on the network.

3) Flow Control: A receiving node can receive the frames at a faster rate than
it can process the frame. Without flow control, the receiver's buffer can
overflow, and frames can get lost. To overcome this problem, the data link layer uses
the flow control to prevent the sending node on one side ofthe link from
overwhelming the receiving node on another side of the link.This prevents traffic
jam at the receiver side.

Prepared by Dept.of CSE(SB) Page 22


GURU NANAK INSTITUTIONS TECHNICAL CAMPUS (AUTONOMOUS)
SCHOOL OF ENGINEERING & TECHNOLOGY

4) Error Control: Error control is achieved by adding a trailer at the end ofthe
frame. Duplication of frames are also prevented by using this mechanism. Data Link
Layers adds mechanism to prevent duplication of frames.
5) Error detection: Errors can be introduced by signal attenuation and noise. Data
Link Layer protocol provides a mechanism to detect one or more errors. This is
achieved by adding error detection bits in the frame and thenreceiving node can
perform an error check.
6) Error correction: Error correction is similar to the Error detection, except that
receiving node not only detects the errors but also determine wherethe errors have
occurred in the frame.
7) Access Control: Protocols of this layer determine which of the devices has
control over the link at any given time, when two or more devices are connected to the
same link.

8) 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. A data link layer mainly provides the reliable delivery service
over the links as they have higher error rates and they can be corrected locally, link at
which an error occurs rather than forcing toretransmit the data.
9) Half-Duplex & Full-Duplex: In a Full-Duplex mode, both the nodes can
transmit the data at the same time. In a Half-Duplex mode, only one node can
transmit the data at the same time.

Prepared by Dept.of CSE(SB) Page 23


GURU NANAK INSTITUTIONS TECHNICAL CAMPUS (AUTONOMOUS)
SCHOOL OF ENGINEERING & TECHNOLOGY

FRAMING

To provide service to the network layer, the data link layer must use the
service provided to it by the physical layer. What the physical layer does is
accept a raw bit stream and attempt to deliver it to the destination. This bit
stream is not guaranteed to be error free. The number of bits received may be
less than, equal to, or more than the number of bits transmitted, and they
may have different values. It is up to the data link layer to detect

and, if necessary, correct errors. The usual approach is for the data link layer
to break the bit stream up into discrete frames and compute the checksum for
each frame (framing). When a frame arrives at the destination, the checksum
is recomputed. If the newly computed checksum is different from the one
contained in the frame, the data link layer knows that an error has occurred and
takes steps to deal with it (e.g., discarding the bad frame and possibly also
sending back an error report).
We will look at four framing methods:

 Character count.

 Flag bytes with byte stuffing.

 Starting and ending flags, with bit stuffing.

 Physical layer coding violations.

Character count method uses a field in the header to specify the number of
characters in the frame. When the data link layer at the destination sees the
character count, it knows how many characters follow and hence where the
end of the frame is. This technique is shown in Fig.
(a) For four frames of sizes 5, 5, 8, and 8 characters, respectively.

Prepared by Dept.of CSE(SB) Page 24


GURU NANAK INSTITUTIONS TECHNICAL CAMPUS (AUTONOMOUS)
SCHOOL OF ENGINEERING & TECHNOLOGY

A character stream. (a) Without errors. (b) With one error


Flag bytes with byte stuffing method gets around the problem of
resynchronization after an error by having each frame start and end with
special bytes. In the past, the starting and ending bytes were different, but in
recent years most protocols have used the same byte, called a flag byte, as
both the starting and ending delimiter, as shown in Fig. (a) as FLAG.
In this way, if the receiver ever loses synchronization, it can just search for the
flag byte to find the end of the current frame. Two consecutive flag bytes
indicate the end of one frame and start of the next one.

Prepared by Dept.of CSE(SB) Page 25


GURU NANAK INSTITUTIONS TECHNICAL CAMPUS (AUTONOMOUS)
SCHOOL OF ENGINEERING & TECHNOLOGY

A frame delimited by flag bytes (b) Four examples of byte sequences before
and after byte stuffing
Starting and ending flags, with bit stuffing allows data frames to contain an
arbitrary number of bits and allows character codes with an arbitrary number
of bits per character. It works like this. Each frame begins and endswith a
special bit pattern, 01111110 (in fact, a flag byte).
Whenever the sender's data link layer encounters five consecutive 1s in the
data, it automatically stuffs a 0 bit into the outgoing bit stream. This bit stuffing
is analogous to byte stuffing, in which an escape byte is stuffed into the
outgoing character stream before a flag byte in the data.

When the receiver sees five consecutive incoming 1 bit, followed by a 0 bit,it
automatically de- stuffs (i.e., deletes) the 0 bit. Just as byte stuffing is completely
transparent to the network layer in both computers, so is bit stuffing. If the user
data contain the flag pattern, 01111110, this flag istransmitted as 011111010
but stored in the receiver's memory as 01111110.

Fig: Bit stuffing. (a) The original data. (b) The data as they appear on the line.

Prepared by Dept.of CSE(SB) Page 26


GURU NANAK INSTITUTIONS TECHNICAL CAMPUS (AUTONOMOUS)
SCHOOL OF ENGINEERING & TECHNOLOGY

(c) The data as they are stored in the receiver's memory after destuffing.

Physical layer coding violations method of framing is only applicable to


networks in which the encoding on the physical medium contains some
redundancy. For example, some LANs encode 1 bit of data by using 2
physicalbits. Normally, a 1 bit is a high-low pair and a 0 bit is a low-high
pair.
The scheme means that every data bit has a transition in the middle,
making it easy for the receiver to locate

the bit boundaries. The combinations high- high and low-low are not used for data but
are used for delimiting frames insome protocols.

ERROR DETECTION

Error is a condition when the receiver’s information does not match with
the sender’s information. During transmission, digital signals suffer from
noise that can introduce errors in the binary bits travelling from sender to
receiver. That means a 0 bit may change to 1 o r a 1 b i t m a y c h a
nge to 0.

Prepared by Dept.of CSE(SB) Page 27


GURU NANAK INSTITUTIONS TECHNICAL CAMPUS (AUTONOMOUS)
SCHOOL OF ENGINEERING & TECHNOLOGY

Error Detecting Codes (Implemented either at Data link layer or Transport


Layer of OSIModel) Whenever a message is
transmitted, it may get scrambled by noise or data
may get corrupted. To avoid this, we use error-detecting codes which are
additional data added to a given digital message to help us detect

if any errorhas occurred during transmission of the message.


Basic approach used for error detection is the use of redundancy bits, where
additional bits are added to facilitate detection of errors. Some popular
techniques for error detection are:
1. Simple Parity check
2. Two-dimensional Parity check
3. Checksum
4. Cyclic redundancy check

1) Simple Parity check


Blocks of data from the source are subjected to a check bit or parity
bitgenerator form, where a parity of: 1 is added to the block if it contains
odd number of 1’s, and 0 is added if it contains even number of 1’sThis
scheme makes the total number of 1’s even, that is why it is called even parity
checking.

Prepared by Dept.of CSE(SB) Page 28


GURU NANAK INSTITUTIONS TECHNICAL CAMPUS (AUTONOMOUS)
SCHOOL OF ENGINEERING & TECHNOLOGY

2) Two-dimensional Parity check


Parity check bits are calculated for each row, which is equivalent to a simple
parity check bit. Parity check bits are also calculated for all columns, then both
are sent along with the data. At the receiving end these are compared with the
parity bits calculated on the received data.

3) Checksum
In checksum error detection scheme, the data is divided into k segmentseach
of m bits. In thesender’s end the segmentsare added using1’s complement
arithmetic to get the sum. The sum is complemented to get the checksum.
The checksum segment is sent along with the data segments.

At the receiver’s end, all received segments are added using 1’s
complementarithmetic to get the sum. The sum is complemented.

Prepared by Dept.of CSE(SB) Page 29


GURU NANAK INSTITUTIONS TECHNICAL CAMPUS (AUTONOMOUS)
SCHOOL OF ENGINEERING & TECHNOLOGY

4) Cyclic redundancy checks (CRC)

Unlike checksum scheme, which is based on addition, CRC is based on


binarydivision.
In CRC, a sequence of redundant bits, called cyclic redundancy check bits, are
appended to the end of data unit so that the resulting data unit becomes exactly
divisible by a second, predetermined binary number.

Prepared by Dept.of CSE(SB) Page 30


GURU NANAK INSTITUTIONS TECHNICAL CAMPUS (AUTONOMOUS)
SCHOOL OF ENGINEERING & TECHNOLOGY

At the destination, the incoming data unit is divided by the same number. Ifat
this step there is no remainder, the data unit is assumed to be correct and is
therefore accepted.
A remainder indicates that the data unit has been damaged in transit and
therefore must be rejected.

Prepared by Dept.of CSE(SB) Page 31


GURU NANAK INSTITUTIONS TECHNICAL CAMPUS (AUTONOMOUS)
SCHOOL OF ENGINEERING & TECHNOLOGY

ERROR CORRECTION

Error Correction codes are used to detect and correct the errors when data
istransmitted from the sender to the receiver.
Error Correction can be handled in two ways: Backward error correction:
Once the error is discovered, the
receiver requeststhe sender to retransmit the entire data unit.
Forward error correction: In this case, the receiver uses the error-correcting
code which automatically corrects the errors.

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
willdetermine 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:
r
2 >=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.
To determine the position of the bit which is in error, a technique developed
by R.W Hamming is Hamming code which can be applied to any length of the
dataunit and uses the relationship between data units and redundant units.

Prepared by Dept.of CSE(SB) Page 32


GURU NANAK INSTITUTIONS TECHNICAL CAMPUS (AUTONOMOUS)
SCHOOL OF ENGINEERING & TECHNOLOGY

HAMMING CODE

Parity bits: The bit which is appended to the original data of binary bits so
thatthe 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
thevalue 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
paritybit is 0.

Prepared by Dept.of CSE(SB) Page 33


GURU NANAK INSTITUTIONS TECHNICAL CAMPUS (AUTONOMOUS)
SCHOOL OF ENGINEERING & TECHNOLOGY

Algorithm of Hamming code:


An information of 'd' bits are added to the redundant bits 'r' to form d+r.The
location of each of the (d+r) digits is assigned a decimal value.
The 'r' bits are placed in the positions 1,2, 2k-1

At the receiving end, the parity bits are recalculated. The decimal value of
theparity bits determines the position of an error.
Relationship b/w Error position & binary number

Let's understand the concept of Hamming code through an example:Suppose


the original data is 1010 which is to be sent.
Total number of data bits 'd' = 4

r r >
Number of redundant bits r: 2 >= d+r+1 2 = 4+r+1

Therefore, the value of r is 3 that satisfies the above

relation.Total number of bits = d+r = 4+3 = 7;

Prepared by Dept.of CSE(SB) Page 34


GURU NANAK INSTITUTIONS TECHNICAL CAMPUS (AUTONOMOUS)
SCHOOL OF ENGINEERING & TECHNOLOGY

Determining the position of the redundant bits


The number of redundant bits is 3. The three bits are represented by r1, r2, r4.
The position of the redundant bits is calculated with corresponds to the raised
power of
2. Therefore, their corresponding positions are 1, 21, 22. The position of r1
= 1, The position of r2 = 2, The position of r4 = 4

Representation of Data on the addition of parity bits:

Determining the Parity bits

Determining the r1 bit: The r1 bit is calculated by performing a parity


check on the bit positions whose binary representation includes 1 in the first
position.

We observe from the above figure that the bit position that includes 1 in
the first position are 1, 3, 5, 7. Now, we perform the even-parity check at
these bitpositions.

Prepared by Dept.of CSE(SB) Page 35


GURU NANAK INSTITUTIONS TECHNICAL CAMPUS (AUTONOMOUS)
SCHOOL OF ENGINEERING & TECHNOLOGY

The total number of 1 at these bit positions corresponding to r1 is even,


therefore, the value of the r1 bit is 0.
Determining r2 bit: The r2 bit is calculated by performing a parity check on
the bit positions whose binary representation includes 1 in the second position

We observe from the above figure that the bit positions that includes 1 in the

second position are 2, 3, 6, 7. Now, we perform the even-parity check at these


bit positions. The total number of 1 at these bit positions corresponding to r2
isodd, therefore, the value of the r2 bit is 1.
Determining r4 bit: The r4 bit is calculated by performing a parity check on
the bit positions whose binary representation includes 1 in the third position.

We observe from the above figure that the bit positions that includes 1 in thethird
position are 4, 5, 6, 7. Now, we perform the even-parity check at these bit positions.
The total number of 1 at these bit positions corresponding to r4 is even, therefore,
the value of the r4 bit is 0.

Prepared by Dept.of CSE(SB) Page 36


GURU NANAK INSTITUTIONS TECHNICAL CAMPUS (AUTONOMOUS)
SCHOOL OF ENGINEERING & TECHNOLOGY

Prepared by Dept.of CSE(SB) Page 37


GURU NANAK INSTITUTIONS TECHNICAL CAMPUS (AUTONOMOUS)
SCHOOL OF ENGINEERING & TECHNOLOGY

Prepared by Dept.of CSE(SB) Page 38

You might also like