DCN Notes Module1
DCN Notes Module1
Allahabad
Department of Electronics and Communication Engineering
CLASS NOTES
Data Communication And Networking
Contents
1 Chapter 1 2
1.1 Network . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.1.1 Network Criteria . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2 Data Communication System . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2.1 Data Flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2.2 Transmission Technology . . . . . . . . . . . . . . . . . . . . . . . 3
1.3 Network Topology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.3.1 Mesh Topology . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.3.2 Star Topology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.3.3 Bus Topology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.3.4 Ring Topology . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.4 Categories of Networks . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.5 Important Network Terminology . . . . . . . . . . . . . . . . . . . . . . . 6
1.5.1 Virtual LAN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.5.2 Standards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.5.3 Statistical Multiplexing . . . . . . . . . . . . . . . . . . . . . . . . 6
1.5.4 Network Connection Types . . . . . . . . . . . . . . . . . . . . . . 6
1.6 Network Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.6.1 Protocol Layering . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.6.2 Scenarios for Protocol Layering . . . . . . . . . . . . . . . . . . . 7
1.6.3 Types of Network Model . . . . . . . . . . . . . . . . . . . . . . . 8
1.6.4 Layers in OSI Model & Their Functionalities . . . . . . . . . . . . 11
1.7 Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
1.7.1 Physical Addresses . . . . . . . . . . . . . . . . . . . . . . . . . . 17
1.7.2 Logical Addresses . . . . . . . . . . . . . . . . . . . . . . . . . . 18
1.7.3 Port Addresses . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
1.7.4 Specific Addresses . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
1
Data Communication & Networking IIIT Allahabad
1 Chapter 1
Introduction
Data communications and networking have changed the way we do business and the way
we live. Businesses rely on computer networks and inter-networks for fast and accu-
rate information exchange. Before studying networking technologies, it is important to
understand how networks operate and what types of designs best meet different needs.
1.1 Network
A network is the interconnection of a set of devices capable of communication. Com-
puter network is a large number of separated but interconnected computers.
2
Data Communication & Networking IIIT Allahabad
3
Data Communication & Networking IIIT Allahabad
4
Data Communication & Networking IIIT Allahabad
• A single backbone cable connects all devices using drop lines and taps.
• Signal strength decreases as it travels along the backbone.
• Advantages: Easy installation and less cabling.
• Disadvantages: Difficult fault isolation, signal degradation, entire network fails if
backbone breaks.
• Example: Early Ethernet LANs.
5
Data Communication & Networking IIIT Allahabad
• PAN: Network meant for one person. Example: Bluetooth network used for con-
necting computer with its peripherals, keyboard mouse.
• LAN:A local area network (LAN) is usually privately owned and links the devices
in a single office, building, or campus. Example: Wi-Fi.
• MAN: Network that covers over a city. Example: Cable TV.
• WAN:Network that spans over a large geographical area. Example: ISP network
(BSNL, JIO Fiber wireless).
• The Internet: A Collection of interconnected networks. Example: Internet.
1.5.2 Standards
Standards provide guidelines to manufacturers, vendors, governments and other service
providers.
• De Facto Standards: Standards that have not been approved by an organized
body but have been adopted as standards through widespread use are de facto
standards.
• De Jure Standards: Those standards that have been legislated by an officially
recognized body are de jure standards.
6
Data Communication & Networking IIIT Allahabad
ii) Connectionless Service: Like the postal system, each message carries full destination
address and each one is routed through the intermediate node inside the system. Ex:
Packet routing. Here, file order may not be preserved.
Set of rules needed: First, greet each other; talk in the same language; refrain from speak-
ing when the other party is speaking; conversation should be a dialogue, not a monologue.
Note: if it is between the professor and the students, then the set of rules is almost the
same, except that conversation is mostly monologue.
Complex Communication Scenario: Now assume Maria and Ann are two top secret
agents, and when they share information, it will be secure from others. So, they both use
encryption/decryption to secure their message transfer over the postal. Example: Maria
talked to the layer 3 machine, which converts it to text, the layer 2 machine encrypted
it, and then sent it to layer 1, where sender and receiver address is attached and posted.
Here, the complex communication task is divided into protocol layering.
Protocol layering enables us to divide a complex task into several smaller and simpler
tasks. In the above example, the communication task at the sender and receiver is divided
into three layers.
Advantages of Protocol Layering:
• Modularity: Protocol layering offers independent layers, which allow for replacing
only the malfunctioning layer instead of changing the whole communication system.
• Independent of Layer Implementation: protocol layering allows us to separate the
services from the implementation. A layer needs to be able to receive a set of services
7
Data Communication & Networking IIIT Allahabad
from the lower layer and to give the services to the upper layer; we don’t care about
how the layer is implemented. Example: The layer 3 job can be implemented by
Maria herself (writing the cipher text on a letter card) or she may hire a machine
(robot) to complete the first layer job (print the cipher text). As long as the first
layer job is done (irrespective of the way of job implementation), in both directions,
the communication system works.
• Easy to Implement Intermediate System: Apart from the two end systems, commu-
nication needs intermediate systems (switch, router), which consist of some layers,
but not all layers. If we did not use protocol layering, we would have to make each
intermediate system as complex as the end systems, which makes the whole system
more expensive.
8
Data Communication & Networking IIIT Allahabad
Figure 11: Logical connections between layers of the TCP/IP protocol suite
b) OSI Model
9
Data Communication & Networking IIIT Allahabad
4. Transport Layer: Ensures reliable data transfer using TCP (reliable) and UDP
(faster, less reliable).
5. Session Layer: Manages sessions between devices including dialog control (keep-
ing track of whose turn it is to transmit), token management and synchronisation
(checkpointing long transmissions to allow them to pick up from where they left
the event of a crash and subsequent recovery).
6. Presentation Layer: Handles data formatting, encryption and compression.
7. Application Layer: Provides end-user services (e.g., HTTP, FTP).
*The intermediate nodes (router, switch) usually involved only first three layers of OSI
Model.
** Each Layer in the sending device adds its own information to the message it receives
from the layer just above it.
***At Each Layer a Header and a possibly Trailer can be added to the data unit as shown
in Fig. 13.
10
Data Communication & Networking IIIT Allahabad
Physical Layer
The physical layer is responsible for movement of individual bits from one hop to next
node. It concerns transmitting raw bits over a communication channel. The design issues
concern ensuring that when one side sends a 1 bit, it is received by the other side as a 1
bit, not as a 0 bit.
• The physical layer coordinates the functions required to carry a bit stream over a
physical medium.
• It deals with the mechanical and electrical specifications of the interface and trans-
mission medium.
• It also defines the procedures and functions that physical devices and interfaces
have to perform for transmission to occur.
The data link is responsible for moving frames from one hop to next hop. The task of the
data link layer is to break up the input data into data frames (typically a few hundred
or a few thousand bytes) and transmits the frames sequentially. If the service is reliable,
the receiver confirms correct receipt of each frame by sending back an acknowledgement
11
Data Communication & Networking IIIT Allahabad
frame.
Another issue that arises in the data link layer (and most of the higher layers as well)
is how to keep a fast transmitter from drowning a slow receiver in data. Some traffic
regulation mechanism is handled by data link layer
• The data link layer transforms the physical layer, a raw transmission facility, to a
reliable link.
• It makes the physical layer appear error-free to the upper layer. Thus it add Trailer
part as shown in Fig. 15. The Header Part is the physical address (MAC) address.
• The data link layer is responsible for moving frames from one hop (node) to the
next
• Hop to Hop delivery: It is also called as Node to Node delivery. As in Fig. 16, to
send data from A to F, three partial deliveries are made. First, the data link layer
at A sends a frame to the data link layer at B, then B to E followed by E to F hop
delivery.
Figure 15: Adding Header and Trailer to Data received from upper layer.
12
Data Communication & Networking IIIT Allahabad
the receiver address is the address of the device that connects the network to the
next one.
3. Flow control: If the rate at which the data are absorbed by the receiver is less
than the rate at which data are produced in the sender, the data link layer imposes
a flow control mechanism to avoid overwhelming the receiver.
4. Error control: The data link layer adds reliability to the physical layer by
adding mechanisms to detect and retransmit damaged or lost frames. It also uses
a mechanism to recognize duplicate frames.
5. Access control: When two or more devices are connected to the same link, data
link layer protocols are necessary to determine which device has control over the
link at any given time.
Network Layer
The network layer is responsible for the source-to-destination delivery of a packet, possibly
across multiple networks (links).If two systems are connected to the same link, there is
usually no need for a network layer.
Network Layer is responsible for end-to-end delivery. Other responsibilities of the network
layer:
• Logical Addressing: The network layer adds a header to the packet coming
from the upper layer that, among other things, includes the logical addresses (IP
Address) of the sender and receiver.
• Routing: When independent networks or links are connected to create inter-
networks (network of networks) or a large network, the connecting devices (called
routers) route or switch the packets to their final destination. Defining the best
route is called routing.
As the figure 17 shows, now we need a source-to-destination delivery. The network layer
at A sends the packet to the network layer at B. When the packet arrives at router B,
the router makes a decision based on the final destination (F) of the packet. As we will
see in later chapters, router B uses its routing table to find that the next hop is router
E. The network layer at B, therefore, sends the packet to the network layer at E. The
13
Data Communication & Networking IIIT Allahabad
Transport Layer
The transport layer is responsible for process-to-process delivery of the entire message
(Fig. 18). A process is an application program running on a host. Whereas the network
layer oversees source-to-destination delivery of individual packets, it does not recognize
any relationship between those packets.
The transport layer, on the other hand, ensures that the whole message arrives intact
and in order, overseeing both error control and flow control at the source-to-destination
level.
14
Data Communication & Networking IIIT Allahabad
connection oriented transport layer makes a connection with the transport layer at
the destination machine first before delivering the packets. After all the data are
transferred, the connection is terminated.
• Flow Control: Like the data link layer, the transport layer is responsible for flow
control. However, flow control at this layer is performed end to end rather than
across a single link.
• Error Control: Like the data link layer, the transport layer is responsible for error
control. However, error control at this layer is performed process-toprocess rather
than across a single link.
Session Layer
The session layer is the network dialog controller. It establishes, maintains, and synchro-
nizes the interaction among communicating systems.
Presentation Layer
The presentation layer is concerned with the syntax and semantics of the information
exchanged between two systems. The presentation layer is responsible for translation,
compression, and encryption.
• Translation: The processes (running programs) in two systems are usually ex-
changing information in the form of character strings, numbers, and so on. The
infonnation must be changed to bit streams before being transmitted. Because dif-
ferent computers use different encoding systems, the presentation layer is responsi-
15
Data Communication & Networking IIIT Allahabad
ble for interoperability between these different encoding methods. The presentation
layer at the sender changes the information from its sender-dependent format into
a common format. The presentation layer at the receiving machine changes the
common format into its receiver-dependent format.
• Encryption: To carry sensitive information, a system must be able to ensure
privacy. Encryption means that the sender transforms the original information to
another form and sends the resulting message out over the network. Decryption
reverses the original process to transform the message back to its original form.
• Compression: Data compression reduces the number of bits contained in the
information. Data compression becomes particularly important in the transmission
of multimedia such as text, audio, and video.
Application Layer
The application layer enables the user, whether human or software, to access the net-
work. It provides user interfaces and support for services such as electronic mail, remote
file access and transfer, shared database management, and other types of distributed
information services.
Fig. 22 shows the relationship of the application layer to the user and the presentation
layer. Of the many application services available, the figure shows only three: SMTP,
Telnet, and HTTP.
16
Data Communication & Networking IIIT Allahabad
1.7 Addressing
Four levels of addresses are used in an internet employing the TCP/IP protocols (Fig.
23): 1) Physical (link) addresses, 2) Logical (IP) addresses, 3) Port addresses, and 4)
Specific addresses .
The size and format of these addresses vary depending on the network. For example,
Ethernet uses a 6-byte (48-bit) physical address that is imprinted on the network inter-
face card (NIC). It is A 6-byte (12 hexadecimal digits) such as: 07:01:02:01 :2C:4B .
In Fig. 24 a node with physical address 10 sends a frame to a node with physical address
87. The two nodes are connected by a link (bus topology LAN). At the data link layer,
17
Data Communication & Networking IIIT Allahabad
this frame contains physical (link) addresses in the header. These are the only addresses
needed. The rest of the header contains other information needed at this level. The
trailer usually contains extra bits needed for error detection. As the figure shows, the
computer with physical address 10 is the sender, and the computer with physical address
87 is the receiver. The data link layer at the sender receives data from an upper layer.
It encapsulates the data in a frame, adding a header and a trailer. The header, among
other pieces of information, carries the receiver and the sender physical (link) addresses.
Note that in most data link protocols, the destination address, 87 in this case, comes
before the source address (10 in this case). We have shown a bus topology for an isolated
LAN. In a bus topology, the frame is propagated in both directions (left and right). The
frame propagated to the left dies when it reaches the end of the cable if the cable end is
terminated appropriately. The frame propagated to the right is sent to every station on
the network. Each station with a physical addresses other than 87 drops the frame be-
cause the destination address in the frame does not match its own physical address. The
intended destination computer, however, finds a match between the destination address
in the frame and its own physical address. The frame is checked, the header and trailer
are dropped, and the data part is de-capsulated and delivered to the upper layer.
The logical addresses are designed for this purpose. A logical address in the Internet is
currently a 32-bit (IPV4) address (example of Public IP: [Link]) that can uniquely
define a host connected to the Internet. No two publicly addressed and visible hosts on
the Internet can have the same Public IP address.
18
Data Communication & Networking IIIT Allahabad
from one computer to another is not complete. Today, computers are devices that can run
multiple processes at the same time. The end objective of Internet communication is a
process communicating with another process. For example, computer A can communicate
with computer C by using TELNET. At the same time, computer A communicates with
computer B by using the File Transfer Protocol (FTP). For these processes to receive
data simultaneously, we need a method to label the different processes. In other words,
they need addresses. In the TCP/IP architecture, the label assigned to a process is called
a port address. A port address in TCP/IP is 16 bits in length ( 216 port address).
Fig. 25 shows two computers communicating via the Internet. The sending computer
is running three processes at this time with port addresses i, j and k. The receiving
computer is running two processes at this time with port addresses a and b. Process i in
the sending computer needs to communicate with process a in the receiving computer.
Note that although both computers are using the same application, FTP, for example,
the port addresses are different because one is a client program and the other is a server
program. To show that data from process a need to be delivered to process a, and not
b, the transport layer encapsulates data from the application layer in a packet and adds
two port addresses (i and a), source and destination. The packet from the transport
layer is then encapsulated in another packet at the network layer with logical source and
destination addresses (A and P). Finally, this packet is encapsulated in a frame with
the physical source and destination addresses of the next hop. We have not shown the
physical addresses because they change from hop to hop inside the cloud designated as
the Internet. Note that although physical addresses change from hop to hop, logical and
port addresses remain the same from the source to destination.
19