Established as per the Section 2(f) of the UGC Act, 1956
Approved by AICTE, COA and BCI, New Delhi
Computer Networking
COURSE CODE: B22EP0603
Dept. of Electronics and Computer
Engineering
D r M a n j u n a t h R Ko u n t e
Unit-1:
Introduction to Data Communication and
Networking
COURSE OBJECTIVES:
This course will enable the students to:
1. Understand the basics of data communication and networking.
2. Classify multiple access methods and identify different LANs.
3. Illustrate functions of network layer and demonstrate different
routing protocol
4. Discuss transport layer and application layer protocol
COURSE OUTCOMES:
After studying this course, students will be able to:
CO# Course Outcomes
Explain the fundamental concepts of basic networking, Protocols,
CO1
Standards and Layered models
CO2 Compare OSI Model & TCP/IP Suite
CO3 Differentiate multiple access methods and LANs
CO4 Evaluate different transport layer protocols
CO5 Evaluate different application layer protocols
CO6 Evaluate different application layer protocols
UNIT-1:
INTRODUCTION TO DATA COMMUNICATION AND
NETWORKING
Layered tasks
OSI Model
TCP/IP Suite and Comparison of OSI Model & TCP/IP Suite.
Addressing of TCP/IP Model.
Framing, Flow and Error Control
Protocols: Noiseless channels and noisy channels
HDLC
LAYERED TASKS
FatMax 2007. Licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 License
LAYERED TASKS
We use the concept of layers in our daily life. As an example, let us
consider two friends who communicate through postal mail. The
process of sending a letter to a friend would be complex if there
were no services available from the post office.
Topics discussed in this section:
Sender, Receiver, and Carrier
Hierarchy
Figure Tasks involved in sending a letter
THE OSI MODEL
Established in 1947, the International Standards Organization
(ISO) is a multinational body dedicated to worldwide agreement
on international standards. An ISO standard that covers all
aspects of network communications is the Open Systems
Interconnection (OSI) model. It was first introduced in the late
1970s.
Topics discussed in this section:
Layered Architecture
Peer-to-Peer Processes
Encapsulation
Note
ISO is the organization.
OSI is the model.
OSI MODEL
Figure Seven layers of the OSI model
Figure The interaction between layers in the OSI model
Figure An exchange using the OSI model
LAYERS IN THE OSI MODEL
In this section we briefly describe the functions of each
layer in the OSI model.
Topics discussed in this section:
Physical Layer
Data Link Layer
Network Layer
Transport Layer
Session Layer
Presentation Layer
Application Layer
Figure Physical layer
Note
The physical layer is responsible for movements of
individual bits from one hop (node) to the next.
Figure Data link layer
Note
The data link layer is responsible for moving
frames from one hop (node) to the next.
Figure Hop-to-hop delivery
Figure Network layer
Note
The network layer is responsible for the
delivery of individual packets from
the source host to the destination host.
Figure Source-to-destination delivery
Figure Transport layer
Note
The transport layer is responsible for the delivery
of a segment from one process to another.
Figure Reliable process-to-process delivery of a message
Figure Session layer
Note
The session layer is responsible for dialog
control and synchronization.
Figure Presentation layer
Note
The presentation layer is responsible for translation,
compression, and encryption.
Figure Application layer
Note
The application layer is responsible for
providing services to the user.
Figure Summary of layers
TCP/IP MODEL
THE TCP/IP REFERENCE MODEL
TCP/IP PROTOCOL SUITE
The layers in the TCP/IP protocol suite do not exactly match those in
the OSI model. The original TCP/IP protocol suite was defined as
having four layers: host-to-network, internet, transport, and
application. However, when TCP/IP is compared to OSI, we can say
that the TCP/IP protocol suite is made of five layers: physical, data
link, network, transport, and application.
Topics discussed in this section:
Physical and Data Link Layers
Network Layer
Transport Layer
Application Layer
Figure TCP/IP and OSI model
Full Forms: TCP/IP and OSI model
1. SMTP – Simple Mail Transfer Protocol
2. FTP – File Transfer Protocol
3. HTTP – Hyper Text Transfer Protocol
4. DNS – Domain Name Server
5. SNMP – Simple Network Management Protocol
6. SCTP - Stream Control Transmission Protocol
7. TCP – Transmission Control Protocol
8. UDP – User Datagram Protocol
9. ARP - Address Resolution Protocol
10. RARP - Reverse Address Resolution Protocol
11. ICMP - Internet Control Message Protocol
12. IGMP - Internet Group Management Protocol
13. IP – Internet Protocol
ADDRESSING
MULTIPLEXING AND
DEMULTIPLEXING
ADDRESSING
Four levels of addresses are used in an internet employing
the TCP/IP protocols: physical, logical, port, and specific.
Topics discussed in this section:
Physical Addresses
Logical Addresses
Port Addresses
Specific Addresses
Figure Addresses in TCP/IP
Figure Relationship of layers and addresses in TCP/IP
Physical Address
Physical addresses are imprinted on the NIC.
Most local-area networks (Ethernet) use a
48-bit (6-byte) physical address written as 12
hexadecimal digits; every byte (2
hexadecimal digits) is separated by a colon.
Example:
07:01:02:01:2C:4B
A 6-byte (12 hexadecimal digits) physical
address.
Physical Address
• known also as the MAC address
• Is the address of a node as defined by its
LAN or WAN
• It is included in the frame used by data link
layer
The physical addresses in the datagram may change
from hop to hop.
Logical Address
IP addresses are necessary for universal
communications that are independent of physical
network.
No two host address on the internet can have the
same IP address
IP addresses in the Internet are 32-bit address that
uniquely define a host.
The physical addresses will change from hop to hop,
but the logical addresses usually remain the same.
Port addresses
Port address is a 16-bit address represented by one decimal
number ranged from (0-65535) to choose a process among multiple
processes on the destination host.
Destination port number is needed for delivery.
Source port number is needed for receiving a reply as an
acknowledgments.
In TCP/IP , a 16-bit port address represented
as one single number. Example: 753
The physical addresses change from hop to hop,
but the logical and port addresses usually remain the same.
Specific addresses
Universal Resource Locator (URL) (www.ksu.edu.sa)
The Domain Name System (DNS) translates human-friendly computer
hostnames ( URL) into IP addresses. For example, www.example.com is
translated to 208.77.188.166
DIFF BETWEEN
OSI AND TCP/IP
TCP/IP V/S OSI
• 4 Layers 1. 7 Layers
• Did not clearly distinguish between 2. Distinction between these three
service, interface and protocol. concepts are explicit.
• Protocols in TCP/IP model are not 3. Protocols in the OSI model are
hidden and tough to replace if better hidden than in the TCP/IP
technology changes. model and can be replaced
relatively easily as the
technology changes.
• The protocols came first, and the 1. The model was not biased toward
model was really just a one particular set of protocols, a fact
description of the existing that made it quite general.
protocols.
• Designers have much experience 2. Designers did not have much
with the subject and have clear experience with the subject and did
idea of which functionality to not have a good idea of which
put in which layer. functionality to put in which layer.
NUMERICALS
Example 1
In Figure 1.1 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). As the figure shows,
the computer with physical address 10 is the sender, and the
computer with physical address 87 is the receiver.
Figure 1.1 Physical addresses
Example 2
most local-area networks use a 48-bit (6-byte) physical
address written as 12 hexadecimal digits; every byte (2
hexadecimal digits) is separated by a colon, as shown
below:
07:01:02:01:2C:4B
A 6-byte (12 hexadecimal digits) physical address.
Example 3
Figure 1.3 shows a part of an internet with two routers
connecting three LANs. Each device (computer or
router) has a pair of addresses (logical and physical) for
each connection. In this case, each computer is
connected to only one link and therefore has only one
pair of addresses. Each router, however, is connected to
three networks (only two are shown in the figure). So
each router has three pairs of addresses, one for each
connection.
Figure 1.3 IP addresses
Note
The physical addresses will change from hop to hop,
but the logical addresses usually remain the same.
Example 4
Figure 1.4 shows two computers communicating via the
Internet. The sending computer is running three
processes at this time with port addresses a, b, and c. The
receiving computer is running two processes at this time
with port addresses j and k. Process a in the sending
computer needs to communicate with process j in the
receiving computer. Note that although physical
addresses change from hop to hop, logical and port
addresses remain the same from the source to
destination.
Figure 1.4 Port addresses
Example 5
a port address is a 16-bit address represented by one
decimal number as shown.
753
A 16-bit port address represented
as one single number.
FRAMING
FRAMING
The data link layer needs to pack bits into frames, so that each
frame is distinguishable from another. Our postal system practices
a type of framing. The simple act of inserting a letter into an
envelope separates one piece of information from another; the
envelope serves as the delimiter.
Topics discussed in this section:
Fixed-Size Framing
Variable-Size Framing
Figure A frame in a character-oriented protocol
Figure Byte stuffing and unstuffing
FRAMING : BYTE STUFFING
(a) A frame delimited by flag bytes.
(b) Four examples of byte sequences before and after stuffing.
Note
Byte stuffing is the process of adding 1 extra byte whenever there is a
flag or escape character in the text.
Figure A frame in a bit-oriented protocol
Note
Bit stuffing is the process of adding one extra 0 whenever five
consecutive 1s follow a 0 in the data, so that the receiver does not
mistake
the pattern 0111110 for a flag.
Figure Bit stuffing and unstuffing
FLOW AND ERROR
CONTROL
FLOW AND ERROR CONTROL
The most important responsibilities of the data link layer are flow
control and error control. Collectively, these functions are known
as data link control.
Topics discussed in this section:
Flow Control
Error Control
Note
Flow control refers to a set of procedures used to restrict the amount of
data
that the sender can send before
waiting for acknowledgment.
Note
Error control in the data link layer is based on automatic repeat
request, which is the retransmission of data.
PROTOCOL
PROTOCOLS
Now let us see how the data link layer can combine framing, flow
control, and error control to achieve the delivery of data from
one node to another. The protocols are normally implemented in
software by using one of the common programming languages.
To make our discussions language-free, we have written in
pseudocode a version of each protocol that concentrates mostly
on the procedure instead of delving into the details of language
rules.
Figure Taxonomy of protocols discussed in this chapter
NOISELESS
CHANNELS
NOISELESS CHANNELS
Let us first assume we have an ideal channel in which no frames
are lost, duplicated, or corrupted. We introduce two protocols for
this type of channel.
Topics discussed in this section:
Simplest Protocol
Figure The design of the simplest protocol with no flow or error control
Algorithm Sender-site algorithm for the simplest protocol
Algorithm Receiver-site algorithm for the simplest protocol
Example
Figure shows an example of communication using this protocol. It is very simple. The sender sends a sequence
of frames without even thinking about the receiver. To send three frames, three events occur at the sender site
and three events at the receiver site. Note that the data frames are shown by tilted boxes; the height of the box
defines the transmission time difference between the first bit and the last bit in the frame.
Figure Flow diagram for Example
NOISY CHANNELS
NOISY CHANNELS
noiseless channels are nonexistent. We discuss one protocols
in this section that use error control.
Topics discussed in this section:
Stop-and-Wait Automatic Repeat Request
Note
Error correction in Stop-and-Wait ARQ is done by keeping a copy of
the sent frame and retransmitting of the frame when the timer expires.
Note
In Stop-and-Wait ARQ, we use sequence numbers to number the
frames.
The sequence numbers are based on modulo-2 arithmetic.
Note
In Stop-and-Wait ARQ, the acknowledgment number always
announces in modulo-2 arithmetic the sequence number of the next
frame expected.
Figure Design of the Stop-and-Wait ARQ Protocol
Algorithm Sender-site algorithm for Stop-and-Wait ARQ
(continued)
Algorithm Sender-site algorithm for Stop-and-Wait ARQ
Example
Figure shows an example of Stop-and-Wait ARQ. Frame 0 is sent and acknowledged. Frame 1 is lost and resent
after the time-out. The resent frame 1 is acknowledged and the timer stops. Frame 0 is sent and acknowledged, but
the acknowledgment is lost. The sender has no idea if the frame or the acknowledgment is lost, so after the time-out,
it resends frame 0, which is acknowledged.
Figure Flow diagram for Example