MODULE 1 COMPUTER NETWORKS 18EC71 (Prof. Nadeem Pasha)
MODULE 1 COMPUTER NETWORKS 18EC71 (Prof. Nadeem Pasha)
MODULE 1 COMPUTER NETWORKS 18EC71 (Prof. Nadeem Pasha)
MODULE 1
SYLLABUS:
Introduction: Data Communications: Components, Data representations, Data Flow, Networks:
Network criteria, Physical Structures, Network Types: LAN, WAN, Switching, The Internet.
Network Models: Protocol Layering: Scenarios, Principles, Logical Connections, TCP/IP
Protocol Suite: Layered Architecture, Layers in TCP/IP suite, Description of layers, Encapsulation
and Decapsulation, Addressing, Multiplexing and Demultiplexing, The OSI Model: OSI Versus
TCP/IP.
---------------------------------------------------------------------------------------------------------------------
DATA COMMUNICATIONS
Data communications are the exchange of data between two devices via some form of
transmission medium such as a wire cable. For data communications to occur, the communicating
devices must be part of a communication system made up of a combination of hardware (physical
equipment) and software (programs).
The effectiveness of a data communications system depends on four fundamental characteristics:
delivery, accuracy, timeliness, and jitter.
1) Delivery-The system must deliver data to the correct destination. Data must be received
by the intended device or user and only by that device or user.
2) Accuracy- The system must deliver the data accurately. Data that have been altered in
transmission and left uncorrected are unusable.
3) Timeliness. The system must deliver data in a timely manner. Data delivered late are
useless.
4) Jitter. Jitter refers to the variation in the packet arrival time. It is the uneven delay in the
delivery of audio or video packets. For example, let us assume that video packets are sent
every 30ms. If some of the packets arrive with 30-ms delay and others with 40-ms delay,
an uneven quality in the video is the result.
Components
[1] Message: The message is the information (data) to be communicated. Popular forms of
information include text, numbers, pictures, audio, and video.
[2] Sender: The sender is the device that sends the data message. It can be a computer,
workstation, telephone handset, video camera, and so on.
[3] Receiver: The receiver is the device that receives the message. It can be a computer,
workstation, telephone handset, television, and so on
[4] Transmission medium: The transmission medium is the physical path by which a message
travels from sender to receiver. Some examples of transmission media include twisted-pair
wire, coaxial cable, fiber-optic cable, and radio waves.
[5] Protocol: A protocol is a set of rules that govern data communications. It represents an
agreement between the communicating devices. Without a protocol, two devices may be
connected but not communicating, just as a person speaking French cannot be understood
by a person who speaks only Japanese.
Data Representation
Information today comes in different forms such as text, numbers, images, audio, and video.
Text -In data communications, text is represented as a bit pattern, a sequence of bits (0s or 1s).
Different sets of bit patterns have been designed to represent text symbols. Each set is called a
code, and the process of representing symbols is called coding.
Numbers: are also represented by bit patterns. However, a code such as ASCII is not used to
represent numbers; the number is directly converted to a binary number to simplify mathematical
operations. Appendix B discusses several different numbering systems.
Images: are also represented by bit patterns. In its simplest form, an image is composed of a matrix
of pixels (picture elements), where each pixel is a small dot. The size of the pixel depends on the
resolution.
Audio: Audio refers to the recording or broadcasting of sound or music. Audio is by nature
different from text, numbers, or images. It is continuous, not discrete. Even when we use a
microphone to change voice or music to an electric signal, we create a continuous signal.
Video: Video refers to the recording or broadcasting of a picture or movie. Video can either be
produced as a continuous entity (e.g., by a TV camera), or it can be a combination of images, each
a discrete entity, arranged to convey the idea of motion.
Data Flow
NETWORKS
A network is the interconnection of a set of devices capable of communication. a device can be a
host (or an end system as it is sometimes called) such as a large computer, desktop, laptop,
workstation, cellular phone, or security system.
A device can also be a connecting device such as a router, which connects the network to other
networks, a switch, which connects devices together, a modem (modulator-demodulator), which
changes the form of data, and so on.
These devices in a network are connected using wired or wireless transmission media such as cable
or air.
NETWORK CRITERIA
A network must be able to meet a certain number of criteria. The most important of these are
performance, reliability, and security.
Performance- Performance can be measured in many ways, including transit time and response
time. Transit time is the amount of time required for a message to travel from one device to another.
Response time is the elapsed time between an inquiry and a response. The performance of a
network depends on a number of factors, including the number of users, the type of transmission
medium, the capabilities of the connected hardware, and the efficiency of the software
Performance is often evaluated by two networking metrics: throughput and delay.
Reliability- network reliability is measured by the frequency of failure, the time it takes a link to
recover from a failure, and the network’s robustness in a catastrophe.
Security- security issues include protecting data from unauthorized access, protecting data from
damage and development, and implementing policies and procedures for recovery from breaches
and data losses.
Physical Structures
Type of Connection
A network is two or more devices connected through links. A link is a communications pathway
that transfers data from one device to another.
Point-to-Point -A point-to-point connection provides a dedicated link between two devices. The
entire capacity of the link is reserved for transmission between those two devices. Most point-to
point connections use an actual length of wire or cable to connect the two ends, but other options,
such as microwave or satellite links, are also possible (see Figure1.3 a).
Example-When we change television channels by infrared remote control, we are establishing a
point-to-point connection between the remote control and the television’s control system.
Multipoint: A multipoint (also called multidrop) connection is one in which more than two
specific devices share a single link (see Figure1.3 b).
PHYSICAL TOPOLOGY
The term physical topology refers to the way in which a network is laid out physically. The
topology of a network is the geometric representation of the relationship of all the links and nodes
to another. There are five types of topologies. They are,
(i) Mesh topology
(ii) Star topology
(iii) Bus topology
(iv) Ring topology
(v) Hybrid topology
Mesh topology: In a mesh topology, every device has a dedicated point-to-point link to every
other device. The term dedicated means that the link carries traffic only between the two devices
it connects. A fully connected mesh network has n (n-1) physical channels to link n devices. To
accommodate the links every device on the network must have (n-1) I/O ports.
Advantages: a) Mesh topology is robust. b) better privacy
and security. c) Failure of one link will not disturb other
links. d) Helps the network manager to find the precise
location of the fault and solution.
Star Topology: In a star topology, each device has a dedicated point-to-point link to a central
controller (HUB) only. If one link fails, that link is affected. All other links remain active.
Bus topology: One long cable acts as a backbone to link all the devices in the network. Nodes are
connected to the back bone by taps and drop lines. Drop line is establishing the connection between
the devices and the cable. The taps are used as connectors. To keep the energy level of the signal
the taps are placed in the limited distance.
Ring topology: In a ring topology, each device has a dedicated point-to-point link with other
devices. Each device is linked only to its immediate neighbors. A signal is travel along the ring in
only one direction from device to device until it reaches its destination. The repeater is used to
regenerate the signals during the transmission.
(ii) MAN (Metropolitan Area Network): It is a "LAN" that has been extended so that it
covers a larger area such as an entire city. Your ISP is an example of a MAN.
(iii) WAN (Wide Area Network): It is a "LAN" that has been extended to cover a wider
area such as multiple sites around the world, an entire country, or even the whole world.
It may be private in that it connects all the sites within a single company or it may be
public such as the network of computers that make up the network for running all the
Google related sites around the world.
Switching
An internet is a switched network in which a switch connects at least two links together. A switch
needs to forward data from a network to another network when required.
The two most common types of switched networks are circuit-switched and packet-switched
networks.
Circuit-Switched Network
The thick line connecting two switches is a high-capacity communication line that can handle
four voice communications at the same time; the capacity can be shared between all pairs of
telephone sets. The switches used in this example have forwarding tasks but no storing
capability.
The reason to make the capacity of the thick line four times the capacity of each voice line is that
we do not want communication to fail when all telephone sets at one side want to be connected
with all telephone sets at the other side.
Packet-Switched Network
In a computer network, the communication between the two computers is done in blocks of data
called packets. This allows switches to function for both storing and forwarding because a packet
is an independent entity that can be stored and sent later. Fig shows a small packet-switched
network that connects four computers at one site to four computers at the other site.
A router in a packet-switched network has a queue that can store and forward the packet.
THE INTERNET
An internet is two or more networks that can communicate with each other. The most notable
internet is called the Internet (uppercase I), and is composed of thousands of interconnected
networks.
Figure 1.15 shows a conceptual (not geographical) view of the Internet. The figure shows the
Internet as several backbones, provider networks, and customer networks. At the top level, the
backbones are large networks owned by some communication companies such as Sprint, Verizon
(MCI), AT&T, and NTT. The backbone networks are connected through some complex switching
systems, called peering points. At the second level, there are smaller networks, called provider
networks, that use the services of the backbones for a fee. The provider networks are connected to
backbones and sometimes to other provider networks.
The customer networks are networks at the edge of the Internet that actually use the services
provided by the Internet. They pay fees to provider networks for receiving services. Backbones
and provider networks are also called Internet Service Providers (ISPs). The backbones are often
referred to as international ISPs; the provider networks are often referred to as national or regional
ISP.
PROTOCOL LAYERING
• A protocol defines the rules that both the sender and receiver and all intermediate devices
need to follow to be able to communicate effectively.
• When communication is simple, we may need only one simple protocol. When
communication is complex, we need to divide the task b/w different layers. We need a
protocol at each layer, or protocol layering.
Scenarios
First Scenario
• In the first scenario, communication is so simple that it can occur in only one Layer (Figure
1.9).
• Assume Maria and Ann are neighbors with a lot of common ideas.
• Communication between Maria and Ann takes place in one layer, face to face, in the same
language.
Second Scenario
• Maria and Ann communicate using regular mail through the post office (Figure 1.10).
• However, they do not want their ideas to be revealed by other people if the letters are
intercepted.
• They agree on an encryption/decryption technique.
• The sender of the letter encrypts it to make it unreadable by an intruder; the receiver of the
letter decrypts it to get the original letter.
Protocol Layering
• Protocol layering enables us to divide a complex task into several smaller and simpler tasks.
- Modularity means independent layers.
• A layer (module) can be defined as a black box with inputs and outputs, without concern
about how inputs are changed to outputs.
• If two machines provide the same outputs when given the same inputs, they can replace
each other.
Disadvantage: 1) Having a single layer makes the job easier. There is no need for each layer
to provide a service to the upper layer and give service to the lower layer.
Logical Connections
• We have layer-to-layer communication (Figure 1.11). –
• There is a logical connection at each layer through which 2 end systems can send
the object created from that layer.
TCP/IP is a protocol-suite used in the Internet today. Protocol-suite refers a set of protocols
organized in different layers. It is a hierarchical protocol made up of interactive modules, each of
which provides a specific functionality. The term hierarchical means that each upper-level protocol
is supported by the services provided by one or more lower-level protocols.
Layered Architecture
Let us assume that computer A communicates with computer B as shown in Figure 1.12. As the
Figure 1.13 shows, we have five communicating devices;
i. Source host(computer A)
ii. Link-layer switch in link 1
iii. Router
iv. Link-layer switch in link 2
The destination host receives the message at the physical layer and then delivers the message
through the other layers to the application layer. The router is involved in only three layers; there
is no transport or application layer. A router is involved in n combinations of link and physical
layers, where n is the number of links the router is connected to. The reason is that each link may
use its own data-link or physical protocol. A link-layer switch is involved only in two layers
namely, data-link layer and physical layer.
As shown in the figure1.14, the duty of the application, transport, and network layers is end-to-
end. However, the duty of the data-link and physical layers is hop-to-hop. A hop is a host or router.
The domain of duty of the top three layers is the internet. The domain of duty of the two lower
layers is the link. In top 3 layers, the data unit should not be changed by any router or link-layer
switch.
In bottom 2 layers, the data unit is changed only by the routers, not by the link-layer switches.
Identical objects exist between two hops. Because router may fragment the packet at the network
layer and send more packets than received (Figure 1.15). The link between two hops does not
change the object.
Physical Layer: The physical layer receives bits from the data-link layer and sends through the
transmission media. The physical layer is responsible for movements of individual bits from one
node to another node. Transmission media is another hidden layer under the physical layer. Two
devices are connected by a transmission medium (cable or air). The transmission medium does not
carry bits; it carries electrical or optical signals.
Data Link Layer: Data-link-layer (DLL) is responsible for moving frames from one node to
another node over a link. The link can be wired LAN/WAN or wireless LAN/WAN. The data-link
layer
• Gets the datagram from network layer
• Encapsulates the datagram in a packet called a frame.
• Sends the frame to physical layer.
TCP/IP model does not define any specific protocol. DLL supports all the standard and proprietary
protocols. Each protocol may provide a different service. Some protocols provide complete error
detection and correction; some protocols provide only error correction.
Network Layer
The network layer is responsible for source-to-destination transmission of data. The network layer
is also responsible for routing the packet. The routers choose the best route for each packet. Why
we need the separate network layer?
• The separation of different tasks between different layers - The routers do not need the
application and transport layers.
• TCP/IP model defines 4 protocols. They are; (i) IP (Internetworking Protocol) (ii) ARP
(Address Resolution Protocol)( iii) ICMP (Internet Control Message Protocol) (iv) IGMP
(Internet Group Message Protocol)
Transport Layer
Transport Layer protocols are responsible for delivery of a message from a process to another
process. The transport layer gets the message from the application layer and encapsulates the
message in a packet called a segment then sends the segment to network layer.
TCP/IP model defines 3 protocols for transport layer; (i). TCP (Transmission Control Protocol)
(ii). UDP (User Datagram Protocol) (iii). SCTP (Stream Control Transmission Protocol)
i) TCP
➢ TCP is a reliable connection-oriented protocol. A connection is established b/w the sender
and receiver before the data can be transmitted.
➢ TCP provides flow control, error control and congestion control services.
ii) UDP
iii) SCTP
➢ SCTP provides support for newer applications such as voice over the Internet.
➢ It combines the best features of UDP and TCP.
Application Layer
The two application layers exchange messages between each other. Communication at the
application layer is between two processes (two programs running at this layer). To communicate,
a process sends a request to the other process and receives a response. Process-to-process
communication is the duty of the application layer. TCP/IP model defines following protocols;
i. FTP (File Transfer Protocol): FTP is used for transferring files from one host to another.
ii. SMTP (Simple Mail Transfer Protocol): SMTP is used to transport email between a
source and destination.
iii. DNS (DomainName System): DNS is used to find the IP address of a computer
iv. HTTP (Hyper Text Transfer Protocol): HTTP is used for accessing the World Wide
Web (WWW)
v. SNMP (Simple Network Management Protocol): SNMP is used to manage the Internet
at global and local levels
vi. TELNET (Terminal Network): TELNET is used for accessing a site remotely.
1) At the application layer, the data to be exchanged is a message. A message does not contain
header or trailer, but if it does, we refer to the whole as the message. The message is passed to
the transport layer.
2) The transport layer takes the message and it adds transport layer header which contains the
identifier of the source and destination application program that wants to communicate plus
some more information that is needed for the end-to end delivery of the message, such as
information needed for flow, error control, or congestion control. The result is the transport
layer packet, which is called the segment (in TCP) and the user datagram (in UDP). The
transport layer then passes the packet to the network layer.
3) The network layer takes segment (user datagram) as data or payload and adds its own header
to the payload. The header contains the addresses of the source and destination hosts and some
more information used for error checking of the header, fragmentation information, and so on.
The result is the network-layer packet, called a datagram. The network layer then passes the
packet to the data-link layer.
4) The data-link layer takes the datagram as data or payload and adds its own header, which
contains the link-layer addresses of the host or the next hop (the router). The result is the link-
layer packet, which is called a frame. The frame is passed to the physical layer for transmission.
At the destination host, each layer only decapsulates the packet received, removes the payload,
and delivers the payload to the next-higher layer protocol until the message reaches the application
layer. During decapsulation error checking is done.
Addressing:
Any communication between two parties needs two addresses, source address and destination
address. TCP/IP has five layers but we require only four addresses because physical layer does not
need any address.
At application layer, we use names to define the site that provide services such as xyzorg.com or
email address such as [email protected].
At transport layer, addresses are called port numbers, and these define application layer programs
at source and destination. These port numbers allow different application on the same computer to
share network resources immediately.
At network layer, the addresses are global. A network layer address uniquely defines connection
of a device to the internet. A logical address is currently a 32 bit address that defines a host
connection to a network.
The link layer address are local address which define a specific host or router in a network (LAN
or WAN). Physical address change from hop to hop but logical and port address remains same.
Multiplexing means that a protocol at a layer encapsulates a packet from several next-higher layer
protocols (one at a time). Demultiplexing means that a protocol can decapsulates and deliver a
packet to several next higher layer protocol (one at a time).
Figure (a) shows the concept of multiplexing and demultiplexing at the three upper layer,
For multiplexing and demultiplexing, a protocol needs to have a field in its header to identify to
which protocol the encapsulated packets belong.
OSI MODEL
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. An open system is a set of
protocols that allows any two different systems to communicate regardless of their underlying
architecture.
The purpose of the OSI model is to show how to facilitate communication between different
systems without requiring changes to the logic of the underlying hardware and software. The OSI
model is not a protocol; it is a model for understanding and designing a network architecture that
is flexible, robust, and interoperable. The OSI model was intended to be the basis for the creation
of the protocols in the OSI stack. The OSI model is a layered framework for the design of network
systems that allows communication between all types of computer systems. It consists of seven
separate but related layers, each of which defines a part of the process of moving information
across a network.
When we compare the two models, we find that two layers, session and presentation, are missing
from the TCP/IP protocol suite. These two layers were not added to the TCP/IP protocol suite after
the publication of the OSI model. The application layer in the suite is usually considered to be the
combination of three layers in the OSI model, as shown in Figure 2.12. Two reasons were
mentioned for this decision. First, TCP/IP has more than one transport-layer protocol. Some of the
functionalities of the session layer are available in some of the transport layer protocols.
Second, the application layer is not only one piece of software. Many applications can be
developed at this layer. If some of the functionalities mentioned in the session and presentation
layers are needed for a particular application, they can be included in the development of that piece
of software.