UNIT 1 NOTES (PART 1) CN
UNIT 1 NOTES (PART 1) CN
Data Communication:
When we communicate, we are sharing information. This sharing can be local or remote. Between
individuals, local communication usually occurs face to face, while remote communication takes place
over distance.
Components:
A data communications system has five components.
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 (Os or Is).
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. Today, the prevalent coding system is called
1
Unicode, which uses 32 bits to represent a symbol or character used in any language in the world. The
American Standard Code for Information Interchange (ASCII), developed some decades ago in the
United States, now constitutes the first 127 characters in Unicode and is also referred to as Basic Latin.
Numbers:
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:
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
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
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. Again we can change video to a digital or an
analog signal.
Data Flow
Communication between two devices can be simplex, half-duplex, or full-duplex as shown in Figure
2
Simplex:
In simplex mode, the communication is unidirectional, as on a one-way street. Only one of the
two devices on a link can transmit; the other can only receive (see Figure a). Keyboards and traditional
monitors are examples of simplex devices. The keyboard can only introduce input; the monitor can
only accept output. The simplex mode can use the entire capacity of the channel to send data in one
direction.
Half-Duplex:
In half-duplex mode, each station can both transmit and receive, but not at the same time.
When one device is sending, the other can only receive, and vice versa The half-duplex mode is like a
one-lane road with traffic allowed in both directions.
When cars are traveling in one direction, cars going the other way must wait. In a half- duplex
transmission, the entire capacity of a channel is taken over by whichever of the two devices is
transmitting at the time. Walkie-talkies and CB (citizens band) radios are both half-duplex systems.
The half-duplex mode is used in cases where there is no need for communication in both
directions at the same time; the entire capacity of the channel can be utilized for each direction.
Full-Duplex:
In full-duplex both stations can transmit and receive simultaneously One common example of
full-duplex communication is the telephone network. When two people are communicating by a
telephone line, both can talk and listen at the same time. The full- duplex mode is used when
communication in both directions is required all the time. The capacity of the channel, however, must
be divided between the two directions.
NETWORKS
A 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.
• Distributed Processing
Most networks use distributed processing, in which a task is divided among multiple computers.
Instead of one single large machine being responsible for all aspects of a process, separate computers
(usually a personal computer or workstation) handle a subset.
Network Criteria
A network must be able to meet a certain number of criteria. The most important of these are
3
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. We often need more throughput and less delay. However,
these two criteria are often contradictory. If we try to send more data to the network, we may increase
throughput but we increase the delay because of traffic congestion in the network.
Reliability:
In addition to accuracy of delivery, 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:
Network 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. For visualization purposes, it is simplest to imagine any
link as a line drawn between two points. For communication to occur, two devices must be connected
in some way to the same link at the same time. There are two possible types of connections: point-to-
point and multipoint.
1.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. When you change television channels by infrared remote control,
you are establishing a point-to- point connection between the remote control and the television's control
system.
2. Multipoint:
A multipoint (also called multidrop) connection is one in which more than two specific devices
4
share a single link. In a multipoint environment, the capacity of the channel is shared, either spatially
or temporally. If several devices can use the link simultaneously, it is a spatially shared
connection. If users must take turns, it is a timeshared connection.
• Physical Topology
The term physical topology refers to the way in which a network is laid out physically. One or more
devices connect to a link; two or more links form a topology. The topology of a network is the
geometric representation of the relationship of all the links and linking devices (usually called nodes) to
one another. There are four basic topologies possible: mesh, star, bus, and ring
Mesh: 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. To find the
number of physical links in a fully connected mesh network with n nodes, we first consider that each
node must be connected to every other node. Node 1 must be connected to n - I nodes, node 2 must be
connected to n – 1 nodes, and finally node n must be connected to n - 1 nodes. We need n(n - 1)
physical links. However, if each physical link allows communication in both directions (duplex
mode), we can divide the number of links by 2. In other words, we can say that in a mesh
topology, we need n(n -1) /2 duplex-mode links.
5
To accommodate that many links, every device on the network must have n – 1 input/output
(VO) ports to be connected to the other n - 1 stations.
Advantages:
• The use of dedicated links guarantees that each connection can carry its own data load, thus eliminating
the traffic problems that can occur when links must be shared by multiple devices.
• A mesh topology is robust. If one link becomes unusable, it does not incapacitate the entire system.
Third, there is the advantage of privacy or security. When every message travels along a dedicated line,
only the intended recipient sees it. Physical boundaries prevent other users from gaining access to
messages. Finally, point-to- point links make fault identification and fault isolation easy. Traffic can be
routed to avoid links with suspected problems. This facility enables the network manager to discover
the precise location of the fault and aids in finding its cause and solution.
Disadvantages:
• Disadvantage of a mesh are related to the amount of cabling because every device must be connected to
every other device, installation and reconnection are difficult.
• Second, the sheer bulk of the wiring can be greater than the available space (in walls, ceilings, or
floors) can accommodate. Finally, the hardware required to connect each link (I/O ports and cable) can
be prohibitively expensive.
Star Topology:
In a star topology, each device has a dedicated point-to-point link only to a central controller,
usually called a hub. The devices are not directly linked to one another. Unlike a mesh topology, a star
topology does not allow direct traffic between devices. The controller acts as an exchange: If one
device wants to send data to another, it sends the data to the controller, which then relays the data to the
other connected device . A star topology is less expensive than a mesh topology. In a star, each device
needs only one link and one I/O port to connect it to any number of others. This factor also makes it
6
easy to install and reconfigure.
Other advantages include robustness. If one link fails, only that link is affected. All other links remain
active. This factor also lends itself to easy fault identification and fault isolation. As long as the hub is
working, it can be used to monitor link problems and bypass defective links.
One big disadvantage of a star topology is the dependency of the whole topology on one single point,
the hub. If the hub goes down, the whole system is dead. Although a star requires far less cable than a
mesh, each node must be linked to a central hub. For this reason, often more cabling is required in a star
than in some other topologies (such as ring or bus).
Bus Topology:
The preceding examples all describe point-to-point connections. A bus topology, on the other
hand, is multipoint. One long cable acts as a backbone to link all the devices in a network
Nodes are connected to the bus cable by drop lines and taps. A drop line is a connection
running between the device and the main cable. A tap is a connector that either splices into the main
cable or punctures the sheathing of a cable to create a contact with the metallic core. As a signal travels
along the backbone, some of its energy is transformed into heat. Therefore, it becomes weaker and
weaker as it travels farther and farther. For this reason there is a limit on the number of taps a bus can
support and on the distance between those taps.
Advantages of a bus topology include ease of installation. Backbone cable can be laid along the
most efficient path, then connected to the nodes by drop lines of various lengths. In this way, a bus uses
7
less cabling than mesh or star topologies. In a star, for example, four network devices in the same room
require four lengths of cable reaching all the way to the hub. In a bus, this redundancy is eliminated.
Only the backbone cable stretches through the entire facility. Each drop line has to reach only as far as
the nearest point on the backbone.
Disadvantages include difficult reconnection and fault isolation. A bus is usually designed to be
optimally efficient at installation. It can therefore be difficult to add new devices. Signal reflection at
the taps can cause degradation in quality. This degradation can be controlled by limiting the number
and spacing of devices connected to a given length of cable. Adding new devices may therefore require
modification or replacement of the backbone.
In addition, a fault or break in the bus cable stops all transmission, even between devices on the same
side of the problem. The damaged area reflects signals back in the direction of origin, creating noise
in both directions.
Bus topology was the one of the first topologies used in the design of early local area networks.
Ethernet LANs can use a bus topology, but they are less popular.
Ring Topology In a ring topology, each device has a dedicated point-to-point connection with only the
two devices on either side of it. A signal is passed along the ring in one direction, from device to
device, until it reaches its destination. Each device in the ring incorporates a repeater. When a device
receives a signal intended for another device, its repeater regenerates the bits and passes them along
A ring is relatively easy to install and reconfigure. Each device is linked to only its immediate
neighbors (either physically or logically). To add or delete a device requires changing only two
connections. The only constraints are media and traffic considerations (maximum ring length and
number of devices). In addition, fault isolation is simplified. Generally in a ring, a signal is circulating
at all times. If one device does not receive a signal within a specified period, it can issue an alarm. The
alarm alerts the network operator to the problem and its location.
However, unidirectional traffic can be a disadvantage. In a simple ring, a break in the ring (such
as a disabled station) can disable the entire network. This weakness can be solved by using a dual ring
8
or a switch capable of closing off the break. Ring topology was prevalent when IBM introduced its
local-area network Token Ring. Today, the need for higher-speed LANs has made this topology less
popular. Hybrid Topology A network can be hybrid. For example, we can have a main star topology
with each branch connecting several stations in a bus topology as shown in Figure.
There are mainly three types of computer networks based on their size:
1. Local Area Network (LAN)
2. Metropolitan Area Network (MAN)
3. Wide area network (WAN)
9
1. Local Area Network (LAN)
1. Local area network is a group of computers connected with each other in a small places
such as school, hospital, apartment etc.
2. LAN is secure because there is no outside connection with the local area network thus the
data which is shared is safe on the local area network and can’t be accessed outside.
3. LAN due to their small size are considerably faster, their speed can range anywhere from
100 to 100Mbps.
4. LANs are not limited to wire connection, there is a new evolution to the LANs that allows
local area network to work on a wireless connection.
MAN network covers larger area by connections LANs to a larger network of computers. In
Metropolitan area network various Local area networks are connected with each other through
telephone lines. The size of the Metropolitan area network is larger than LANs and smaller than
WANs(wide area networks), a MANs covers the larger area of a city or town.
10
3. Wide area network (WAN)
Wide area network provides long distance transmission of data. The size of the WAN is larger
than LAN and MAN. A WAN can cover country, continent or even a whole world. Internet
connection is an example of WAN. Other examples of WAN are mobile broadband
connections such as 3G, 4G etc.
Advantages of WAN:
Centralized infrastructure: One of the main advantages of WAN is the that we do not need
to maintain the backup and store data on local system as everything is stored online on a
data Centre, from where we can access the data through WAN.
Privacy: We can setup the WAN in such a way that it encrypts the data that we share online
that way the data is secure and minimizes the risk of unauthorized access.
Increased Bandwidth: With the WAN we get to choose the bandwidth based on the need, a
large organization can have larger bandwidth that can carry large amount of data faster and
efficiently.
Area: A WAN can cover a large area or even a whole world though internet connection thus
we can connect with the person in another country through WAN which is not possible is
other type of computer networks.
Disadvantages of WAN:
Antivirus: Since our systems are connected with the large amount of systems, there is
possibility that we may unknowingly download the virus that can affect our system and become
threat to our privacy and may lead to data loss.
Expensive: Cost of installation is very high.
Issue resolution: Issue resolution takes time as the WAN covers large area, it is really difficult
to pin point the exact location where the issues raised and causing the problem.
11
Difference between LAN, MAN, and WAN
The following table highlights all the key differences between LAN, MAN, and WAN
−
Basis of
LAN MAN WAN
Comparison
Full Form LAN stands for Local Area MAN stands for WAN stands for Wide
Network. Metropolitan Area Area Network.
Network.
Speed Data transmission speed is Data transmission speed is Data transmission speed is
high. average. low.
Operational Its operational speed usually Its operational speed Its operation is speed
Speed is 10,100 and 1000 Mbps. usually is 1.5 Mbps, and it usually is 100 Mbps.
may be very at the wireless
network.
Fault There is higher fault tolerance There is smaller fault There is smaller fault
Tolerance in LAN. tolerance. tolerance.
Communicati LAN allows a small number MAN allows simultaneous WAN allows a very large
on Allotment of computers to establish a communication of a large number of computers to
communication. number of computers. interact simultaneously
with each other
Congestion In LANs, the network In MANs, the network In WANs, the network is
congestion is very low due to congestion is high. very high.
less number of computers
Propagation In LANs, the propagation In MANs, the propagation In WANs, the propagation
Delay delay is very less. delay is moderate. delay is very high.
The advantages of a multipoint connection over a point-to-point connection are ease of installation, low
cost, reliability. A point-to-point connection is used for connecting 2 devices, whereas in a multipoint
connection more than 2 devices share the communication link.
Geographical area spanned by a network determines whether it is a LAN or a WAN. A LAN, or Local
Area Network, spans a relatively smaller area, whereas a WAN, or Wide Area Network, covers a much
larger area. Also, WANs have a higher propagation delay than LANs because of the large distance to be
covered
A protocol is a set of rules and standards that primarily outline a language that devices will use to
communicate. There are an excellent range of protocols in use extensively in networking, and that they
are usually implemented in numerous layers.
It provides a communication service where the process is used to exchange the messages. When the
communication is simple, we can use only one simple protocol.
When the communication is complex, we must divide the task between different layers, so, we need to
follow a protocol at each layer, this technique we used to call protocol layering. This layering allows us
to separate the services from the implementation.
Each layer needs to receive a set of services from the lower layer and to give the services to the upper
layer. The modification done in any one layer will not affect the other layers.
Disadvantages
Logical Connections
A logical network is a portion of a physical network that connects two or more logical network
interfaces or devices. A logical network interface or device is the software entity that is known by an
operating system.
Layered Architecture :
14
A communication subsystem is a complex piece of Hardware and software. Early attempts for
implementing the software for such subsystems were based on a single, complex, unstructured program
with many interacting components. The resultant software was very difficult to test and modify. To
overcome such problem, the ISO has developed a layered approach. In a layered approach, networking
concept is divided into several layers, and each layer is assigned a particular task. Therefore, we can say
that networking tasks depend upon the layers.
Layered Architecture
o The main aim of the layered architecture is to divide the design into small pieces.
o Each lower layer adds its services to the higher layer to provide a full set of services to manage communications
and run the applications.
o It provides modularity and clear interfaces, i.e., provides interaction between subsystems.
o It ensures the independence between layers by providing the services from lower to higher layer without defining
how the services are implemented. Therefore, any modification in a layer will not affect the other layers.
o The number of layers, functions, contents of each layer will vary from network to network. However, the
purpose of each layer is to provide the service from lower to a higher layer and hiding the details from the layers
of how the services are implemented.
o The basic elements of layered architecture are services, protocols, and interfaces.
o Service: It is a set of actions that a layer provides to the higher layer.
o Protocol: It defines a set of rules that a layer uses to exchange the information with peer entity. These rules
mainly concern about both the contents and order of the messages used.
o Interface: It is a way through which the message is transferred from one layer to another layer.
o In a layer n architecture, layer n on one machine will have a communication with the layer n on another machine
and the rules used in a conversation are known as a layer-n protocol.
Let's take an example of the five-layered architecture.
15
o In case of layered architecture, no data is transferred from layer n of one machine to layer n of another machine.
Instead, each layer passes the data to the layer immediately just below it, until the lowest layer is reached.
o Below layer 1 is the physical medium through which the actual communication takes place.
o In a layered architecture, unmanageable tasks are divided into several small and manageable tasks.
o The data is passed from the upper layer to lower layer through an interface. A Layered architecture provides a
clean-cut interface so that minimum information is shared among different layers. It also ensures that the
implementation of one layer can be easily replaced by another implementation.
o A set of layers and protocols is known as network architecture.
o Divide-and-conquer approach: Divide-and-conquer approach makes a design process in such a way that the
unmanageable tasks are divided into small and manageable tasks. In short, we can say that this approach reduces
the complexity of the design.
o Modularity: Layered architecture is more modular. Modularity provides the independence of layers, which is
easier to understand and implement.
o Easy to modify: It ensures the independence of layers so that implementation in one layer can be changed
without affecting other layers.
o Easy to test: Each layer of the layered architecture can be analyzed and tested individually.
TCP/IP model
o The TCP/IP model was developed prior to the OSI model.
o The TCP/IP model is not exactly similar to the OSI model.
o The TCP/IP model consists of five layers: the application layer, transport layer, network layer, data link layer
and physical layer.
o The first four layers provide physical standards, network interface, internetworking, and transport functions that
correspond to the first four layers of the OSI model and these four layers are represented in TCP/IP model by a
single layer called the application layer.
o TCP/IP is a hierarchical protocol made up of interactive modules, and each of them provides specific
functionality.
Here, hierarchical means that each upper-layer protocol is supported by two or more lower-level
protocols.
Internet Layer
o An internet layer is the second layer of the TCP/IP model.
o An internet layer is also known as the network layer.
o The main responsibility of the internet layer is to send the packets from any network, and they arrive at the
destination irrespective of the route they take.
IP Protocol: IP protocol is used in this layer, and it is the most significant part of the entire TCP/IP
suite.
o IP Addressing: This protocol implements logical host addresses known as IP addresses. The IP addresses are
used by the internet and higher layers to identify the device and to provide internetwork routing.
17
o Host-to-host communication: It determines the path through which the data is to be transmitted.
o Data Encapsulation and Formatting: An IP protocol accepts the data from the transport layer protocol. An IP
protocol ensures that the data is sent and received securely, it encapsulates the data into message known as IP
datagram.
o Fragmentation and Reassembly: The limit imposed on the size of the IP datagram by data link layer protocol is
known as Maximum Transmission unit (MTU). If the size of IP datagram is greater than the MTU unit, then the
IP protocol splits the datagram into smaller units so that they can travel over the local network. Fragmentation
can be done by the sender or intermediate router. At the receiver side, all the fragments are reassembled to form
an original message.
o Routing: When IP datagram is sent over the same local network such as LAN, MAN, WAN, it is known as
direct delivery. When source and destination are on the distant network, then the IP datagram is sent indirectly.
This can be accomplished by routing the IP datagram through various devices such as routers.
ARP Protocol
o The two terms are mainly associated with the ARP Protocol:
o ARP request: When a sender wants to know the physical address of the device, it broadcasts the ARP request to
the network.
o ARP reply: Every device attached to the network will accept the ARP request and process the request, but
only recipient recognize the IP address and sends back its physical address in the form of ARP reply. The
recipient adds the physical address both to its cache memory and to the datagram header
ICMP Protocol
Transport Layer
The transport layer is responsible for the reliability, flow control, and correction of data which is
being sent over the network.
18
The two protocols used in the transport layer are User Datagram protocol and Transmission
control protocol.
Application Layer
19
o An application layer is the topmost layer in the TCP/IP model.
o It is responsible for handling high-level protocols, issues of representation.
o This layer allows the user to interact with the application.
o When one application layer protocol wants to communicate with another application layer, it forwards its data to
the transport layer.
o There is an ambiguity occurs in the application layer. Every application cannot be placed inside the application
layer except those who interact with the communication system. For example: text editor cannot be considered in
application layer while web browser using HTTP protocol to interact with the network where HTTP protocol is
an application layer protocol.
Encapsulation:
Encapsulation refers to attaching new information in the Application Layer data as it is passed onto
next layers in the TCP/IP model. This additional information basically divided into two parts, Header
and Trailer. These are elements attached in order to make the transmission more smoother, on each
layer a PDU (Protocol Data Unit) is generated. The concept of Encapsulations can be summarized in
the screenshot attached ahead.
20
Decapsulation :
Decapsulation refers to the removal of all these additional information and extraction of originally
existing data, and this process continues till the last layer i.e. the Application Layer. This process
removes, fragments of distinct information in each layer as it approaches that layer. Here is the
pictorial representation of the whole process.
Multiplexing
Multiplexing is the process of collecting the data from multiple application processes of the sender,
enveloping that data with headers and sending them as a whole to the intended receiver.
In Multiplexing at the Transport Layer, the data is collected from various application processes. These
segments contain the source port number, destination port number, header files, and data.
These segments are passed to the Network Layer which adds the source and destination IP address to
get the datagram.
Demultiplexing
Delivering the received segments at the receiver side to the correct app layer processes is called
demultiplexing.
The destination host receives the IP datagrams; each datagram has a source IP address and a destination
IP address.
Each datagram carries 1 transport layer segment.
Each segment has the source and destination port number.
The destination host uses the IP addresses and port numbers to direct the segment to the appropriate
socket.
21
ADDRESSING
In networking, physical address refers to a computer's MAC address, which is a unique identifier
associated with a network adapter that is used for identifying a computer in a network.
An IP address is also known as a logical address and it can change over time as well as from one
network to another.
22
A port number is a way to identify a specific process to which an internet or other network
message is to be forwarded when it arrives at a server.
Application-specific addresses are used to identify particular applications. For example, the
[email protected] is the address of email, www.beingintelligent.com is the address of a
website.
So, these are the four type of addresses used to communicate in the network using TCP/IP
protocols.
6. THE OSI MODEL: OSI versus TCP/IP, Lack of OSI Model’s Success
OSI Model
o OSI stands for Open System Interconnection is a reference model that describes how information from a
software application in one computer moves through a physical medium to the software application in another
computer.
o OSI consists of seven layers, and each layer performs a particular network function.
o OSI model was developed by the International Organization for Standardization (ISO) in 1984, and it is now
considered as an architectural model for the inter-computer communications.
o OSI model divides the whole task into seven smaller and manageable tasks. Each layer is assigned a particular
task.
o Each layer is self-contained, so that task assigned to each layer can be performed independently.
o The OSI model is divided into two layers: upper layers and lower layers.
o The upper layer of the OSI model mainly deals with the application related issues, and they are implemented
only in the software. The application layer is closest to the end user. Both the end user and the application layer
interact with the software applications. An upper layer refers to the layer just above another layer.
o The lower layer of the OSI model deals with the data transport issues. The data link layer and the physical layer
are implemented in hardware and software. The physical layer is the lowest layer of the OSI model and is closest
23
to the physical medium. The physical layer is mainly responsible for placing the information on the physical
medium.
There are the seven OSI layers. Each layer has different functions. A list of seven layers are
given below:
1. Physical Layer
2. Data-Link Layer
3. Network Layer
4. Transport Layer
5. Session Layer
6. Presentation Layer
7. Application Layer
1) Physical layer
24
o The main functionality of the physical layer is to transmit the individual bits from one node to another node.
o It is the lowest layer of the OSI model.
o It establishes, maintains and deactivates the physical connection.
o It specifies the mechanical, electrical and procedural network interface specifications.
o Line Configuration: It defines the way how two or more devices can be connected physically.
o Data Transmission : It defines the transmission mode whether it is simplex, half-duplex or full-duplex
mode between the two devices on the network.
o Signals: It determines the type of the signal used for transmitting the information.
2) Data-Link Layer
o Framing: The data link layer translates the physical's raw bit stream into packets known as Frames. The Data
link layer adds the header and trailer to the frame. The header which is added to the frame contains the hardware
destination and source address.
o Physical Addressing: The Data link layer adds a header to the frame that contains a destination address. The
frame is transmitted to the destination address mentioned in the header.
o Flow Control: Flow control is the main functionality of the Data-link layer. It is the technique through which the
constant data rate is maintained on both the sides so that no data get corrupted. It ensures that the transmitting
station such as a server with higher processing speed does not exceed the receiving station, with lower
processing speed.
o Error Control: Error control is achieved by adding a calculated value CRC (Cyclic Redundancy Check) that is
placed to the Data link layer's trailer which is added to the message frame before it is sent to the physical layer. If
any error seems to occurr, then the receiver sends the acknowledgment for the retransmission of the corrupted
frames.
o Access Control: When two or more devices are connected to the same communication channel, then the data
link layer protocols are used to determine which device has control over the link at a given time.
3) Network Layer
o It is a layer 3 that manages device addressing, tracks the location of devices on the network.
o It determines the best path to move data from source to the destination based on the network conditions, the
26
o The Data link layer is responsible for routing and forwarding the packets.
o Routers are the layer 3 devices, they are specified in this layer and used to provide the routing services within
an internetwork.
o The protocols used to route the network traffic are known as Network layer protocols. Examples of protocols are
IP and Ipv6.
o Internetworking: An internetworking is the main responsibility of the network layer. It provides a logical
connection between different devices.
o Addressing : A Network layer adds the source and destination address to the header of the frame.
Addressing is used to identify the device on the internet.
o Routing: Routing is the major component of the network layer, and it determines the best optimal path out
of the multiple paths from source to the destination.
o Packetizing: A Network Layer receives the packets from the upper layer and converts them into packets. This
process is known as Packetizing. It is achieved by internet protocol (IP).
4) Transport Layer
o The Transport layer is a Layer 4 ensures that messages are transmitted in the order in which they are sent and
there is no duplication of data.
o The main responsibility of the transport layer is to transfer the data completely.
o It receives the data from the upper layer and converts them into smaller units known as segments.
o This layer can be termed as an end-to-end layer as it provides a point-to-point connection between source
and destination to deliver the data reliably.
o Service-point addressing: Computers run several programs simultaneously due to this reason, the transmission
of data from source to the destination not only from one computer to another computer but also from one
process to another process. The transport layer adds the header that contains the address known as a service-
point address or port address. The responsibility of the network layer is to transmit the data from one computer
to another computer and the responsibility of the transport layer is to transmit the message to the correct
process.
o Segmentation and reassembly: When the transport layer receives the message from the upper layer, it divides
the message into multiple segments, and each segment is assigned with a sequence number that uniquely
identifies each segment. When the message has arrived at the destination, then the transport layer reassembles the
message based on their sequence numbers.
o Connection control: Transport layer provides two services Connection-oriented service and connectionless
service. A connectionless service treats each segment as an individual packet, and they all travel in different
routes to reach the destination. A connection-oriented service makes a connection with the transport layer at the
destination machine before delivering the packets. In connection-oriented service, all the packets travel in the
single route.
o Flow control: The transport layer also responsible for flow control but it is performed end-to-end rather than
across a single link.
o Error control: The transport layer is also responsible for Error control. Error control is performed end-to-end
rather than across the single link. The sender transport layer ensures that message reach at the destination without
any error.
5) Session Layer
28
o It is a layer 3 in the OSI model.
o The Session layer is used to establish, maintain and synchronizes the interaction between communicating
devices.
o Dialog control: Session layer acts as a dialog controller that creates a dialog between two processes or we can
say that it allows the communication between two processes which can be either half-duplex or full-duplex.
o Synchronization: Session layer adds some checkpoints when transmitting the data in a sequence. If some error
occurs in the middle of the transmission of data, then the transmission will take place again from the checkpoint.
This process is known as Synchronization and recovery.
5. Presentation Layer
• A Presentation layer is mainly concerned with the syntax and semantics of the information exchanged between the
two systems.
29
• It acts as a data translator for a network.
• This layer is a part of the operating system that converts the data from one presentation format to another format.
• The Presentation layer is also known as the syntax layer.
• Translation: The processes in two systems exchange the information in the form of character strings, numbers and
so on. Different computers use different encoding methods, the presentation layer handles the interoperability
between the different encoding methods. It converts the data from sender-dependent format into a common
format and changes the common format into receiver-dependent format at the receiving end.
• Encryption: Encryption is needed to maintain privacy. Encryption is a process of converting the sender-transmitted
information into another form and sends the resulting message over the network.
• Compression: Data compression is a process of compressing the data, i.e., it reduces the number of bits to be
transmitted. Data compression is very important in multimedia such as text, audio, video.
6. Application Layer
• An application layer serves as a window for users and application processes to access network service.
• It handles issues such as network transparency, resource allocation, etc.
• An application layer is not an application, but it performs the application layer functions.
• This layer provides the network services to the end-users.
• File transfer, access, and management (FTAM): An application layer allows a user to access the files in a remote
computer, to retrieve the files from a computer and to manage the files in a remote computer.
• Mail services: An application layer provides the facility for email forwarding and storage.
• Directory services: An application provides the distributed database sources and is used to provide that global
information about various objects.
The OSI Layer model has seven layers while the TCP/IP model has four layers.
30
The OSI Layer model is no longer used while the TCP/IP is still used in computer networking.
To define the functionalities of upper layers, the OSI model uses three separate layers (Application,
Presentation, and Session) while the TCP/IP model uses a single layer (Application).
Just like the upper layers, the OSI model uses two separate layers (Physical and Data-link) to define the
functionalities of the bottom layers while the TCP/IP uses a single layer (Link layer) for the same.
To define the routing protocols and standards, the OSI model uses the Network layer while the TCP/IP
model uses the Internet layer.
The OSI model is well documented than the TCP/IP model.
The OSI model explains every standard and protocol in detail while the TCP/IP model provides a
summarized version of the same.
Differences between the original TCP/IP model and the updated TCP/IP model
The TCP/IP model which we use nowadays is slightly different from the original TCP/IP model. The
original TCP/IP model has four layers while the updated TCP/IP model has five layers.
The original version uses a single layer (Link layer) to define the functionalities and components that
are responsible for data transmission. The updated version uses two layers (Data Link and Physical) for
the same.
It defines the functions that are directly related to the data transmission in the Physical layer and defines
the functions that are indirectly related to the data transmission in the Data-link layer.
In the updated version, the name of the Internet layer is changed to the Network layer.
The following figure compares the OSI reference model, the original TCP/IP model, and the updated
TCP/IP model.
-Many applications do not require/need the data integrity, which is provided by OSI-model.
-In order to fast set up OSI requires agreement b/w three-parties: users & service provider.
-Complex.
OSI model couldn’t compete with TCP/IP model, and failed in getting wider acceptance. One of the
main reasons behind the failure of OSI model and wider acceptance of TCP/IP model was because
big global networks like internet started running on TCP/IP protocol suite.
7. Physical Layer- Transmision Media
In transmission media is the way the systems are connected to route data signals in a network.
The telecommunication links are classified into two categories −
Both guided and unguided are used for short distance (LANs, MANs) as well as long distance
(WANs) communication.
Let us discuss Guided transmission media.
33
Fiber Optic Cables
Step 1 − In fiber optic cable the information is transmitted by propagation of optical signals (light)
through fiber optic cables and not through the electrical/electromagnetic signals. Because of this, the
fiber optics communication supports longer distances as there is no electrical interference.
Step 2 −: The fiber optic cables are made of very thin strands of glass (silica). It supports high data
rates.
Step 3 − It is used for accessing the internet from home through FTTH (Fiber-To-The- Home) lines.
Examples − OC-48, OC-192, FTTC, HFC.
The fiber optic cable is diagrammatically represented as follows −
34
Now let us discuss Unguided Transmission media.
Microwaves
Step 1 − Microwaves travel in straight lines and therefore the narrow focus concentrates all the energy
into a beam.
Step 2 − In microwaves periodic repeaters are necessary for long distances and for transmitting and
receiving antennas are aligned accurately.
Example − Bluetooth technology.
Satellite
Step 1 − Use microwave radio to protect from the atmosphere and act as a microwave relay station.
Step 2 − They are situated in space 22,000 miles above the equator, and it appears stationary from the
earth as it rotates with specific speed.
Step 3 − They can amplify and relay microwave signals from one transmitter on the ground to
another.
Differences
The major differences between guided and unguided transmission media are as follows −
35
The signal requires a physical path for The signal is broadcasted through air or sometimes
transmission. water
It provides direction to signal for travelling. It does not provide any direction. Radio waves,
Twisted pair cable, coaxial cable and fibre microwave and infrared are its types.
optic cable are its types.
A socket is one endpoint of a two way communication link between two programs running on the
network. The socket mechanism provides a means of inter-process communication (IPC) by
establishing named contact points between which the communication take place.
Like ‘Pipe’ is used to create pipes and sockets is created using ‘socket’ system call. The socket
provides bidirectional FIFO Communication facility over the network. A socket connecting to the
network is created at each end of the communication. Each socket has a specific address. This address
is composed of an IP address and a port number.
Socket are generally employed in client server applications. The server creates a socket, attaches it
to a network port addresses then waits for the client to contact it. The client creates a socket and then
attempts to connect to the server socket. When the connection is established, transfer of data takes
place.
A socket is an endpoint for sending and receiving data in a network, used in both TCP and UDP
communication. Mastering socket programming is key for building network applications.
Types of Sockets : There are two types of Sockets: the datagram socket and the stream socket.
1. Datagram Socket : This is a type of network which has connection less point for sending and
receiving packets. It is similar to mailbox. The letters (data) posted into the box are collected and
delivered (transmitted) to a letterbox (receiving socket).
2. Stream Socket In Computer operating system, a stream socket is type of interprocess
communications socket or network socket which provides a connection-oriented, sequenced, and
unique flow of data without record boundaries with well defined mechanisms for creating and
destroying connections and for detecting errors. It is similar to phone. A connection is established
between the phones (two ends) and a conversation (transfer of data) takes place.
36
Socket Programming
Socket programming is a way to connect two nodes on a network so they can communicate with
each other. It enables the exchange of data between applications running on different devices or
computers. A socket is an endpoint of a two-way communication link between two programs running
on a network. It is bound to a port number so that the TCP layer can identify the application that data is
destined to be sent to.
In simple terms, a socket is like a door between two applications. When you want to send data
from one application to another, you need to open a door (create a socket) on both sides. The sending
application puts the data through its door, and the receiving application picks it up from its own door.
Socket programming involves creating a socket, binding it to a specific address and port, and then
sending or receiving data through that socket. It provides a way for applications to communicate with
each other over a network, regardless of whether they are running on the same device or on different
devices.
In Java, there are two main classes used for connection-less socket programming:
DatagramSocket and DatagramPacket
DatagramSocket
This class represents a socket for sending and receiving datagram packets over a network. It allows
you to send and receive individual packets of data without establishing a dedicated connection.
Let’s see how to create a DatagramSocket:
DatagramSocket socket = new DatagramSocket();
DatagramPacket
This class represents a datagram packet, which is used to encapsulate the data being sent or
received through a DatagramSocket. It contains the data as well as the IP address and port number of
the destination or source. Here's an example of creating a DatagramPacket:
byte[] data = "Hello, world!".getBytes();
InetAddress address = InetAddress.getByName("localhost");
int port = 1234;
DatagramPacket packet = new DatagramPacket(data, data.length, address, port);
In this example, we create a byte array containing the data we want to send, specify the destination
address and port, and then create a DatagramPacket with that information.
These two classes form the foundation of connection-less socket programming in Java. They allow you
37
to send and receive data packets without establishing a dedicated connection, making them suitable for
scenarios where quick and lightweight communication is needed.
Client
Socket socket = new Socket("localhost", 1234);
InputStream input = socket.getInputStream();
OutputStream output = socket.getOutputStream();
// Read from and write to the server socket
socket.close();
In this example, the server creates a ServerSocket and waits for a client to connect. Once a client
connects, it creates a new Socket to handle the communication. The client creates a Socket and
specifies the server's address and port. Both the server and client use input and output streams to read
from and write to each other.
TCP socket programming provides reliable communication and is suitable for applications that require
ordered and error-free data delivery, such as file transfers or messaging systems.
Socket Programming Interface Types
In socket programming, there are different types of interfaces that can be used depending on the
specific requirements of the application. The two main types of socket programming interfaces are:
Berkeley Sockets (BSD Sockets)
38
Berkeley Sockets, also known as BSD Sockets, is a widely used socket programming interface.
It was originally developed for the Berkeley Software Distribution (BSD) Unix operating
system.
BSD Sockets provide a set of functions and data structures for creating, manipulating, and using
sockets.
The interface includes functions such as socket(), bind(), listen(), accept(), connect(), send(),
recv(), and close().
BSD Sockets are supported by most operating systems, including Unix, Linux, macOS, and
Windows.
They are commonly used in C and C++ programming languages but are also available in other
languages like Java, Python, and more.
Windows Sockets (Winsock)
Windows Sockets, or Winsock, is a socket programming interface specific to the Microsoft
Windows operating system.
It provides a similar set of functions and data structures as BSD Sockets but with some Windows-
specific extensions and differences.
Winsock includes additional functions and features for asynchronous I/O, overlapped I/O, and
event-driven programming.
It is commonly used in Windows-based applications and is supported by programming languages
such as C++, C#, and Visual Basic.
Winsock functions have a similar naming convention to BSD Sockets but with a "WSA" prefix
(e.g., WSAStartup(), WSASocket(), etc.).
Both BSD Sockets and Winsock provide similar functionality for socket programming, allowing
applications to create sockets, establish connections, and exchange data over a network. The choice
between the two depends on the target operating system and the specific requirements of the
application.
In addition to these two main interfaces, there are also higher-level abstractions and frameworks
available for socket programming in various programming languages. These abstractions often simplify
the process of working with sockets by providing a more convenient and intuitive API while internally
using the underlying socket interfaces.
39