2. Syllabus
• Introduction: Uses of Computer Networks, Types of Computer Networks, OSI Reference
Model, TCP/IP model [4L]
• Review of Physical Layer [4L]
• Data Link Control and Protocols: Link Layer Services, Error detection and Correction
Techniques, Multi Access Protocols, Link Layer Addressing, Ethernet, Hubs, Switches and
Switches, Point to Point Protocol, Asynchronous Transfer Mode, Multiprotocol Label
Switching [6L]
• Network Layer: Introduction, Virtual Circuit and Datagram Networks, IP Addressing,
Subnetting, Routing Algorithms (Link State, Distance Vector, Hierarchical), Routing in the
Internet (RIP, OSPF, BGP), Broadcast and Multicast Routing Algorithms, Routers, ICMP, IPv6
[8L]
• Transport Layer: Introduction to Transport Layer Services, Multiplexing and Demultiplexing,
Connectionless Transport: UDP, Principles of Reliable Data Transfer, Connection Oriented
Transport: TCP, Principles of Congestion Control, TCP Congestion Control, Sockets and Socket
Programming, Quality of services (QOS) [8L]
• Application Layer: Web and HTTP, Domain Name Space (DNS), Electronic Mail (SMTP, MIME,
IMAP, POP3), File Transfer Protocol, Cryptography [6L]
• Introduction to Wireless and Mobile Networks [4L]
3. COs of Theory
• CO1: Understand the layered architecture and explain the contemporary
issues and importance of MAC sublayer of the Data Link Layer, network
layer, transport layer and application layer of TCP-IP model, and how they
can be used to assist in network design and implementation.
• CO2: Understand the protocols of MAC sublayer of the Data Link Layer and
describe the IEEE standards for Ethernet (802.3) and wireless LAN (802.11).
• CO3: Understand internetworking principles and explain algorithms for
multiple access, routing and different networking techniques and able to
analyze the performance of these algorithms.
• CO4: Explain the protocols in Transport Layer and able to design network
applications using these protocols.
• CO5: Explain the protocols in application layer and how they can be used to
design popular internet applications.
4. COs of Lab
• CO1: Design and implement error detection techniques within a
simulated network environment.
• CO2: Design and implement flow control mechanisms of Logical Link
Control of Data Link Layer within a simulated network environment.
• CO3: Design and implement medium access control mechanisms within
a simulated network environment using IEEE 802 standards.
• CO4: Design and implement network layer protocols within a simulated
network environment or network tools using IEEE 802 standards.
• CO5: Design and implement various applications using Transport layer
protocols and Application layer protocols for its implementation in
client/server environment and analyze the performance.
5. Suggested Readings
1. Data Communications and Networking, Behrouz A
Forouzan, McGraw Hill
2. Computer Networks, by Andrew S. Tanenbaum, Prentice
Hall India
3. Computer Networking: A Top-Down Approach Featuring the
Internet, by James F. Kurose and Keith W. Ross, Pearson
Education
Slides are mainly prepared using online documents available
of the above books and course materials of different
institutes
7. Computer Networks Lab
CO1: Design and implement error detection techniques within a simulated network
environment.
8. Error Detection
• Data transmission can contain errors
– Single-bit
– Burst errors of length n
(n: distance between the first and last errors in data block)
• How to detect errors
– If only data is transmitted, errors cannot be detected
Send more information with data that satisfies a special
relationship
Add redundancy
9. Error Detection Methods
• Vertical Redundancy Check (VRC)
– Append a single bit at the end of data block such
that the number of ones is even
Even Parity (odd parity is similar)
0110011 01100110
0110001 01100011
– VRC is also known as Parity Check
– Performance:
• Detects all odd-number errors in a data block
10. Error Detection Methods
• Longitudinal Redundancy Check (LRC)
– Organize data into a table and create a parity for
each column
11100111 11011101 00111001 10101001
11100111
11011101
00111001
10101001
10101010
11100111 11011101 00111001 10101001 10101010
Original Data LRC
11. Error Detection Methods
– Performance:
• Detects all burst errors up to length n
(number of columns)
• Misses burst errors of length n+1 if there are n-1
uninverted bits between the first and last bit
• Checksum
– Used by upper layer protocols
– Similar to LRC, uses one’s complement arithmetic
12. Cyclic Redundancy Check
• Powerful error detection scheme
• Rather than addition, binary division is used
Finite Algebra Theory (Galois Fields)
• Can be easily implemented with small amount
of hardware
– Shift registers
– XOR (for addition and subtraction)
13. Cyclic Redundancy Check
• Let us assume k message bits and
n bits of redundancy
• Associate bits with coefficients of a polynomial
1 0 1 1 0 1 1
1x6
+0x5
+1x4
+1x3
+0x2
+1x+1
= x6
+x4
+x3
+x+1
xxxxxxxxxx yyyy
k bits n bits
Block of length k+n
14. Example
• Send
– M(x) = 110011 x5
+x4
+x+1 (6 bits)
– P(x) = 11001 x4
+x3
+1 (5 bits, n = 4)
4 bits of redundancy
– Form xn
M(x) 110011 0000
x9
+x8
+x5
+x4
– Divide xn
M(x) by P(x) to find C(x)
= C(x)
Send the block 110011 1001
• Receive
No remainder
Accept
100001
1001
11001
10000
11001
1100110000
11001
00000
11001
11001
11001
1100111001
11001
15. Cyclic Redundancy Check
• Let M(x) be the message polynomial
• Let P(x) be the generator polynomial
– P(x) is fixed for a given CRC scheme
– P(x) is known both by sender and receiver
• Create a block polynomial F(x) based on M(x)
and P(x) such that F(x) is divisible by P(x)
)
(
0
)
(
)
(
)
(
x
P
x
Q
x
P
x
F
16. Cyclic Redundancy Check
• Sending
1. Multiply M(x) by xn
2. Divide xn
M(x) by P(x)
3. Ignore the quotient and keep the reminder C(x)
4. Form and send F(x) = xn
M(x)+C(x)
• Receiving
1. Receive F’(x)
2. Divide F’(x) by P(x)
3. Accept if remainder is 0, reject otherwise
17. Assignment 1: Design and implement an error detection module.
Due on: 19-23 October 2020 (in your respective lab classes)
• Design and implement an error detection module which has four schemes namely LRC, VRC,
Checksum and CRC. Please note that you may need to use these schemes separately for other
applications (assignments). You can write the program in any language. The program should
accept the name of a test file (contains a sequence of frames) from the command line and then
print the input data frame, signature block and the output data frame on console standard
output. Next, test the same program to produce a PASS/FAIL result for following cases.
(a) Error is detected by all four schemes. Use a suitable CRC polynomial (list is given in next
page).
(b) Error is detected by checksum but not by CRC.
(c) Error is detected by VRC but not by CRC.
[Note: Inject error in random positions in the input data frame. Write a separate method for
that]
• Please note that your design and implementation of these schemes can help you to make your
assignment different from your classmates. Write the code by yourself and protect your code.
The assignment is simple, but we encourage you to do improvisation with this.
19. Report
• Title: (Basic information like name, class, group, assignment number, problem statement
and date (deadline and submission)).
• Design: (short paragraph describing the purpose of the program, draw a structure
diagram to reflect the procedural organization of the program as you have designed it in
the previous step, input and output format)
• Implementation: (code snippet, method description, interfaces etc.)
• Test cases: (Describe the tests you will perform to verify the correctness of your program.
This should be a thorough and exhaustive list of test cases designed to show that your
program does everything it is supposed to do. The combined tests should exercise every
line of code in your program. For each test case, give sample test data and state what you
are checking.
• Results: (Figures or graphs, tables )
• Analysis: (discussion on results considering different test cases, error, correctness, known
bugs, possible improvements)
• Comments: Evaluate the lab assignment. What did you learn from it? Was it too hard?
(explain why?) Too easy? (explain why?) Suggest improvements if you can.
20. Networks
• Network is a set of devices (often referred to
as nodes) connected by communication links.
• A node can be a computer, printer, or any other
device capable of sending and/or receiving
data generated by other nodes on the network.
A link can be a cable, air, optical fiber, or any
medium which can transport a signal carrying
information.
21. Computer Networks
• Computer network
connects two or more
autonomous
computers.
• The computers can be
geographically located
anywhere.
25. Network Criteria
• Performance
– Depends on Network Elements
– Measured in terms of Delay and Throughput
• Reliability
– Failure rate of network components
– Measured in terms of availability/robustness
• Security
– Data protection against corruption/loss of data due to:
– Errors
– Malicious users
26. Physical Structures
• Type of Connection
– Point to Point - single transmitter and receiver
– Multipoint - multiple recipients of single transmission
• Physical Topology
– Connection of devices
– Type of transmission - unicast, mulitcast, broadcast
29. Network Topology
• The network topology
defines the way in
which computers,
printers, and other
devices are connected.
A network topology
describes the layout of
the wire and devices as
well as the paths used
by data transmissions.
31. Star Topology
• The star topology is the most
commonly used architecture
in Ethernet LANs.
• Larger networks use the
extended star topology also
called tree topology. When
used with network devices
that filter frames or packets,
like bridges, switches, and
routers, this topology
significantly reduces the
traffic on the wires by
sending packets only to the
wires of the destination host.
35. Ring Topology
• A frame travels around the ring,
stopping at each node. If a node
wants to transmit data, it adds
the data as well as the
destination address to the frame.
• The frame then continues around
the ring until it finds the
destination node, which takes
the data out of the frame.
– Single ring – All the devices on the
network share a single cable
– Dual ring – The dual ring topology
allows data to be sent in both
directions.
38. Mesh Topology
• The mesh topology
connects all devices
(nodes) to each other for
redundancy and fault
tolerance.
• It is used in WANs to
interconnect LANs and for
mission critical networks
like those used by banks
and financial institutions.
• Implementing the mesh
topology is expensive and
difficult.
39. Categories of Networks
• Local Area Networks (LANs)
– Short distances
– Designed to provide local interconnectivity
• Wide Area Networks (WANs)
– Long distances
– Provide connectivity over large areas
• Metropolitan Area Networks (MANs)
– Provide connectivity over areas such as a city, a campus
40. LAN, MAN and WAN
• Network in small geographical Area (Room,
Building or a Campus) is called LAN (Local Area
Network)
• Network in a City is call MAN (Metropolitan Area
Network)
• Network spread geographically (Country or across
Globe) is called WAN (Wide Area Network)
43. WAN technologies
• There are two types of long distance
communication technologies that are used for
WANs.
– Dedicated connection
• A dedicated line is a full-time point-to-point connection
provided by a communication carrier that lasts for the
length of the lease period.
– Switched connection
• There are several types of switched connections: circuit
switched, packet switched, and cell switched
44. Circuit Switching
• In circuit switching, circuits are established prior to the
transmission of data and torn down at the end of the
transmission.
• During transmission of data, all of the packets take the
same path.
• The Public Switch Telephone Network (PSTN) is an
example of a circuit switch system.
– A call is placed and a circuit established when the other end of
the circuit is answered.
– Modems that operate between computer systems are a specific
example.
45. Packet Switching
• In packet switching, circuits may be selected
on a packet-by-packet basis.
• The Internet widely uses packet switch
networks, for individual packets in the same
transmission may take different routes
through the network to the same destination.
• Upper layers of the OSI model place the
packets into the correct order.
46. Cell Switching
• Cell switching is associated with Asynchronous Transmission Mode
(ATM) which is considered to be a high speed switching technology
that attempted to overcome the speed problems faced by the
shared media like Ethernet.
• Cell switching uses a connection-oriented packet-switched
network.
– It is called cell switching because this methodology uses a fixed length of
packets of 53 bytes out of which 5 bytes are reserved for header.
– Unlike cell technology, packet switching technology uses variable length
packets.
– Even though cell switching closely resembles packet switching because
cell switching also breaks the information into smaller packets of fixed
length.
50. Protocols
• A protocol is synonymous with rule. It consists
of a set of rules that govern data
communications. It determines -
– what is communicated
– how it is communicated and
– when it is communicated.
• The key elements of a protocol are syntax,
semantics and timing
51. Elements of a Protocol
• Syntax
– Structure or format of the data
– Indicates how to read the bits - field delineation
• Semantics
– Interprets the meaning of the bits
– Knows which fields define what action
• Timing
– When data should be sent and
– What speed at which data should be sent or speed at which it is being
received.
53. Communication Architecture
• Strategy for connecting host computers and other
communicating equipment.
• Defines necessary elements for data communication
between devices.
• A communication architecture, therefore, defines a
standard for the communicating hosts.
• A programmer formats data in a manner defined by the
communication architecture and passes it on to the
communication software.
• Separating communication functions adds flexibility, for
example, we do not need to modify the entire host
software to include more communication devices.
54. Example
• 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.
56. Layer Architecture
• Layer architecture simplifies the network design.
• It is easy to debug network applications in a layered
architecture network.
• The network management is easier due to the layered
architecture.
• Network layers follow a set of rules, called protocol.
• The protocol defines the format of the data being
exchanged, and the control and timing for the
handshake between layers.
57. ISO or OSI
• ISO (International Organization for
Standardization)
– is the organization.
• OSI (Open Systems Interconnection )
– is the model.
58. Open Systems Interconnection (OSI)
Model
• International standard organization (ISO) established a
committee in 1977 to develop an architecture for
computer communication.
• Open Systems Interconnection (OSI) reference model is
the result of this effort.
• In 1984, the Open Systems Interconnection (OSI)
reference model was approved as an international
standard for communications architecture.
• Term “open” denotes the ability to connect any two
systems which conform to the reference model and
associated standards.
59. OSI Reference Model
• The OSI model is now considered the primary Architectural
model for inter-computer communications.
• The OSI model describes how information or data makes its
way from application programmes (such as spreadsheets)
through a network medium (such as wire) to another
application programme located on another network.
• The OSI reference model divides the problem of moving
information between computers over a network medium
into SEVEN smaller and more manageable problems .
• This separation into smaller more manageable functions is
known as layering.
63. OSI: A Layered Network Model
• The process of breaking up the functions or tasks of networking
into layers reduces complexity.
• Each layer provides a service to the layer above it in the protocol
specification.
• Each layer communicates with the same layer’s software or
hardware on other computers.
• The lower 4 layers (transport, network, data link and physical —
Layers 4, 3, 2, and 1) are concerned with the flow of data from end
to end through the network.
• The upper three layers of the OSI model (application, presentation
and session—Layers 7, 6 and 5) are orientated more toward
services to the applications.
• Data is Encapsulated with the necessary protocol information as it
moves down the layers before network transit.
65. Physical Layer
• Provides physical interface for transmission of information.
• Defines rules by which bits are passed from one system to
another on a physical communication medium.
• Covers all - mechanical, electrical, functional and procedural -
aspects for physical communication.
• Such characteristics as voltage levels, timing of voltage
changes, physical data rates, maximum transmission
distances, physical connectors, and other similar attributes
are defined by physical layer specifications.
OSI Model
66. Physical Layer
The physical layer is responsible for movements of
individual bits from one hop (node) to the next.
67. Data Link Layer
• Data link layer attempts to provide reliable communication
over the physical layer interface.
• Breaks the outgoing data into frames and reassemble the
received frames.
• Create and detect frame boundaries.
• Handle errors by implementing an acknowledgement and
retransmission scheme.
• Implement flow control.
• Supports points-to-point as well as broadcast
communication.
• Supports simplex, half-duplex or full-duplex communication.
OSI Model
68. Data Link Layer
The data link layer is responsible for moving
frames from one hop (node) to the next.
70. Network Layer
• Implements routing of frames (packets) through the network.
• Defines the most optimum path the packet should take from
the source to the destination
• Defines logical addressing so that any endpoint can be
identified.
• Handles congestion in the network.
• Facilitates interconnection between heterogeneous networks
(Internetworking).
• The network layer also defines how to fragment a packet into
smaller packets to accommodate different media.
71. Network Layer
The network layer is responsible for the
delivery of individual packets from the source host to
the destination host.
73. Transport Layer
• Purpose of this layer is to provide a reliable mechanism for
the exchange of data between two processes in different
computers.
• Ensures that the data units are delivered error free.
• Ensures that data units are delivered in sequence.
• Ensures that there is no loss or duplication of data units.
• Provides connectionless or connection oriented service.
• Provides for the connection management.
• Multiplex multiple connection over a single channel.
OSI Model
74. Transport Layer
• The transport layer is responsible for the
delivery of a message from one process to
another.
76. Session Layer
• Session layer provides mechanism for controlling the dialogue
between the two end systems. It defines how to start, control and
end conversations (called sessions) between applications.
• This layer requests for a logical connection to be established on an
end-user’s request.
• Any necessary log-on or password validation is also handled by this
layer.
• Session layer is also responsible for terminating the connection.
• This layer provides services like dialogue discipline which can be
full duplex or half duplex.
• Session layer can also provide check-pointing mechanism such that
if a failure of some sort occurs between checkpoints, all data can
be retransmitted from the last checkpoint.
OSI Model
77. Session Layer
• The session layer is responsible for dialog
control and synchronization.
78. Presentation Layer
• Presentation layer defines the format in which the data is to
be exchanged between the two communicating entities.
• Also handles data compression and data encryption
(cryptography).
OSI Model
79. Presentation layer
• The presentation layer is responsible for
translation, compression, and encryption.
80. Application Layer
• Application layer interacts with application programs and is
the highest level of OSI model.
• Application layer contains management functions to support
distributed applications.
• Examples of application layer are applications such as file
transfer, electronic mail, remote login etc.
OSI Model
81. Application layer
• The application layer is responsible for
providing services to the user.
82. OSI in Action
• A message begins at the top application
layer and moves down the OSI layers to
the bottom physical layer.
• As the message descends, each
successive OSI model layer adds a
header to it.
• A header is layer-specific information
that basically explains what functions
the layer carried out.
• Conversely, at the receiving end,
headers are striped from the message
as it travels up the corresponding layers.
OSI Model
85. 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.
89. TCP/IP Model
TCP/IP Model
Application Layer
Application programs using the network
Transport Layer (TCP/UDP)
Management of end-to-end message transmission,
error detection and error correction
Network Layer (IP)
Handling of datagrams : routing and congestion
Data Link Layer
Management of cost effective and reliable data delivery,
access to physical networks
Physical Layer
Physical Media
93. Physical Addresses
• Here 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.
94. • 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.
95. IP Addresses: 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.
96. Port addresses
• 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.
The physical addresses will change from hop to hop,
but the logical addresses usually remain the same.
97. • 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.