CN - Module-1
CN - Module-1
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.
In the case of video and audio, timely delivery means delivering data as they are produced, in the
same order that they are produced, and without significant delay. This kind of delivery is called
real-time transmission.
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
30 ms. 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.
1.1.1 Components
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. Today, the prevalent coding system is called
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.
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. The size of the pixel depends on the
resolution. For example, an image can be divided into 1000 pixels or 10,000 pixels. In the second
case, there is a better representation of the image (better resolution), but more memory isneeded
to store the image.
After an image is divided into pixels, each pixel is assigned a bit pattern. The size and the value of
the pattern depend on the image. For an image made of only blackand- white dots (e.g., a
chessboard), a 1-bit pattern is enough to represent a pixel. If an image is not made of pure white
and pure black pixels, we can increase the size of the bit pattern to include gray scale. For example,
to show four levels of gray scale, we can use 2-bit patterns. A black pixel can be represented by
00, a dark gray pixel by 01, a light gray pixel by 10, and a white pixel by 11.
There are several methods to represent color images. One method is called RGB, so called because
each color is made of a combination of three primary colors: red, green, and blue. The intensity
of each color is measured, and a bit pattern is assigned to it. Another method is called YCM, in
which a color is made of a combination of three other primary colors: yellow, cyan, andmagenta.
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.
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 1.2a). 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 (see Figure 1.2b). 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-duplexmode 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 mode (also called duplex), both stations can transmit and receive simultaneously
(see Figure 1.2c).
The full-duplex mode is like a two-way street with traffic flowing in both directions at the same
time. In full-duplex mode, signals going in one direction share the capacity of the link with signals
going in the other direction. This sharing can occur in two ways: Either the link must contain two
physically separate transmission paths, one for sending and the other for receiving;or the capacity
of the channel is divided between signals traveling in both directions. 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.
1.2 NETWORKS
A network is the interconnection of a set of devices capable of communication. In this definition,
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 in this definition 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. When we connect two computers at home using a plug-
and-play router, we have created a network, although very small.
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. 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.
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.
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, suchas microwave
or satellite links, are also possible (see Figure 1.3a). 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 Figure 1.3b).
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.Two 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 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. 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 – 1 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. To accommodate that many links,
every device on the network must have n – 1 input/output (I/O) ports (see Figure1.4) to be
connected to the other n – 1 stations.
A mesh offers several advantages over other network topologies.
1. First, 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.
2. Second, a mesh topology is robust. If one link becomes unusable, it does not incapacitate the
entire system.
3. 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.
4. 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.
The main disadvantages of a mesh are related to the amount of cabling and the number of I/O ports
required.
1. First, because every device must be connected to every other device, installation and
reconnection are difficult.
2. Second, the sheer bulk of the wiring can be greater than the available space (in walls, ceilings,
or floors) can accommodate.
3. Finally, the hardware required to connect each link (I/O ports and cable) can be prohibitively
expensive. For these reasons a mesh topology is usually implemented in a limited fashion, for
example, as a backbone connecting the main computers of a hybrid network that can include
several other topologies. One practical example of a mesh topology is the connection of telephone
regional offices in which each regional office needs to be connected to every other regional office.
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 (see Figure 1.5) .
1.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 easy to install
and reconfigure. Far less cabling needs to be housed, and additions, moves, and deletions involve
only one connection: between that device and the hub.
2.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). High-speed LANs often
use a star topology with a central hub.
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 (see
Figure 1.6).
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 (see Figure 1.7).
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 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.
Internetwork
Today, it is very rare to see a LAN or a WAN in isolation; they are connected to one another.
When two or more networks are connected, they make an internetwork, or internet. As an
example, assume that an organization has two offices, one on the east coast and the other on the
west coast. Each office has a LAN that allows all employees in the office to communicate with
each other. To make the communication between employees at different offices possible, the
management leases a point-to-point dedicated WAN from a service provider, such as a telephone
company, and connects the two LANs. Now the company has an internetwork, or a private internet
(with lowercase i). Communication between offices is now possible. Figure 1.11 shows this
internet.
When a host in the west coast office sends a message to another host in the same office, the
router blocks the message, but the switch directs the message to the destination. On the other hand,
when a host on the west coast sends a message to a host on the east coast, router R1 routes the
packet to router R2, and the packet reaches the destination. Figure 1.12 shows another internet
with several LANs and WANs connected. One of the WANs is a switched WAN with four
switches.
1.3.3 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
In a circuit-switched network, a dedicated connection, called a circuit, is always available
between the two end systems; the switch can only make it active or inactive.
Figure 1.13 shows a very simple switched network that connects four telephones to each end. We
have used telephone sets instead of computers as an end system because circuit switching was very
common in telephone networks in the past, although part of the telephone network today isa
packet-switched network.
In Figure 1.13, the four telephones at each side are connected to a switch. The switch connects a
telephone set at one side to a telephone set at the other side. The thick line connecting two switches
is a high-capacity communication line that can handle four voice communications at thesame 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.
Let us look at two cases. In the first case, all telephone sets are busy; four people at one site are
talking with four people at the other site; the capacity of the thick line is fully used. In the second
case, only one telephone set at one side is connected to a telephone set at the other side; only one-
fourth of the capacity of the thick line is used. This means that a circuit-switched network is
efficient only when it is working at its full capacity; most of the time, it is inefficient because it is
working at partial capacity. The reason that we need 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 ends is done in blocks of data called
packets. In other words, instead of the continuous communication we see between two telephone
sets when they are being used, we see the exchange of individual data packets between the two
computers. This allows us to make the switches function for both storing and forwarding because
a packet is an independent entity that can be stored and sent later. Figure 1.14 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. Now assume
that the capacity of the thick line is only twice the capacity of the data line connecting the
computers to the routers. If only two computers (one at each site) need to communicate with each
other, there is no waiting for the packets.
However, if packets arrive at one router when the thick line is already working at its full capacity,
the packets should be stored and forwarded in the order they arrived. The two simple examples
show that a packet-switched network is more efficient than a circuit switched network, but the
packets may encounter some delays.
One of the advantages of protocol layering is that it allows us to separate the services from the
implementation. A layer needs to be able to receive a set of services from the lower layer and to
give the services to the upper layer; we don’t care about how the layer is implemented Another
advantage of protocol layering, which cannot be seen in our simple examples but reveals itself
when we discuss protocol layering in the Internet, is that communication
does not always use only two end systems; there are intermediate systems that need only some
layers, but not all layers. If we did not use protocol layering, we would have to make each
intermediate system as complex as the end systems, which makes the whole system more
expensive.
Logical Connections
After following the above two principles, we can think about logical connection between each
layer as shown in Figure 2.3. This means that we have layer-to-layer communication. Maria and
Ann can think that there is a logical (imaginary) connection at each layer through which they can
send the object created from that layer.
TCP/IP PROTOCOL SUITE
Now that we know about the concept of protocol layering and the logical communicationbetween
layers in our second scenario, we can introduce the TCP/IP (Transmission Control
Protocol/Internet Protocol). TCP/IP is a protocol suite (a set of protocols organized in different
layers) used in the Internet today. 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. The original
TCP/IP protocol suite was defined as four software layers built upon the hardware. Today,
however, TCP/IP is thought of as a five-layer model. Figure 2.4 shows both configurations.
The router is involved in only three layers; there is no transport or application layer in a router as
long as the router is used only for routing. Although a router is always involved in one network
layer, it is involved in n combinations of link and physical layers in which 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. For example, in the above figure, the router is involved in three links, but the message
sent from source A to destination B is involved in two links. Each link may be using different link-
layer and physical-layer protocols; the router needs to receive a packet from link 1 based on one
pair of protocols and deliver it to link 2 based on another pair of protocols. A link-layer switch in
a link, however, is involved only in two layers, data-link and physical. Although each switch in
the above figure has two different connections, the connections are in the same link, which uses
only one set of protocols. This means that, unlike a router, a link-layer switch is involved only in
one data-link and one physical layer.
Network Layer
The network layer is responsible for creating a connection between the source computer and the
destination computer. The communication at the network layer is host-to-host. However, since
there can be several routers from the source to the destination, the routers in the path are
responsible for choosing the best route for each packet. We can say that the network layer is
responsible for host-to-host communication and routing the packet through possible routes. Again,
we may ask ourselves why we need the network layer. We could have added the routing duty to
the transport layer and dropped this layer. One reason, as we said before, is the separation of
different tasks between different layers. The second reason is that the routers do not need the
application and transport layers. Separating the tasks allows us to use fewer protocols on the
routers.
The network layer in the Internet includes the main protocol, Internet Protocol (IP), that defines
the format of the packet, called a datagram at the network layer. IP also defines the format and the
structure of addresses used in this layer. IP is also responsible for routing a packet from its source
to its destination, which is achieved by each router forwarding the datagram to the next router in
its path. IP is a connectionless protocol that provides no flow control, no error control, and no
congestion control services. This means that if any of these services is required for an application,
the application should rely only on the transport-layer protocol. The network layer also includes
unicast (one-to-one) and multicast (one-to-many) routing protocols. A routing protocol does not
take part in routing (it is the responsibility of IP), but it creates forwarding tables for routers to
help them in the routing process. The network layer also has some auxiliary protocols that help IP
in its delivery and routing tasks. The Internet Control Message Protocol (ICMP) helps IP to report
some problems when routing a packet. The Internet Group Management Protocol (IGMP) is
another protocol that helps IP in multitasking. The Dynamic Host Configuration Protocol (DHCP)
helps IP to get the network-layer address for a host. The Address Resolution Protocol (ARP) is a
protocol that helps IP to find the link-layer address of a host or a router when its network-layer
address is given.
Transport Layer
The logical connection at the transport layer is also end-to-end. The transport layer at the source
host gets the message from the application layer, encapsulates it in a transport layer packet (called
a segment or a user datagram in different protocols) and sends it, through the logical
(imaginary) connection, to the transport layer at the destination host. In other words, the transport
layer is responsible for giving services to the application
layer: to get a message from an application program running on the source host and deliver it to
the corresponding application program on the destination host.
The main protocol, Transmission Control Protocol (TCP), is a connection-oriented protocol that
first establishes a logical connection between transport layers at two hosts before transferring data.
It creates a logical pipe between two TCPs for transferring a stream of bytes. TCP provides flow
control (matching the sending data rate of the source host with the receiving data rate of the
destination host to prevent overwhelming the destination), error control (to guarantee that the
segments arrive at the destination without error and resending the corrupted ones), and congestion
control to reduce the loss of segments due to congestion in the network. The other common
protocol, User Datagram Protocol (UDP), is a connectionless protocol that transmits user
datagrams without first creating a logical connection. In UDP, each user datagram is an
independent entity without being related to the previous or the next one (the meaning of the term
connectionless). UDP is a simple protocol that does not provide flow, error, or congestion control.
Its simplicity, which means small overhead, is attractive to an application program that needs to
send short messages and cannot afford the retransmission of the packets involved in TCP, when a
packet is corrupted or lost. A new protocol, Stream Control Transmission Protocol (SCTP) is
designed to respond to new applications that are emerging in the multimedia
Application Layer
The two application layers exchange messages between each other as though there were a bridge
between the two layers 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.
The application layer in the Internet includes many predefined protocols, but a user can also create
a pair of processes to be run at the two hosts.
The Hypertext Transfer Protocol (HTTP) is a vehicle for accessing the World Wide Web
(WWW). The Simple Mail Transfer Protocol (SMTP) is the main protocol used in electronic mail
(e-mail) service. The File Transfer Protocol (FTP) is used for transferring files from one host to
another. The Terminal Network (TELNET) and Secure Shell (SSH) are used for accessing a site
remotely. The Simple Network Management Protocol (SNMP) is used by an administrator to
manage the Internet at global and local levels. The Domain Name System (DNS) is used by other
protocols to find the network-layer address of a computer. The Internet Group Management
Protocol (IGMP) is used to collect membership in a group.
Addressing
At the application layer, we normally use names to define the site that provides services, such as
someorg.com, or the e-mail address, such as [email protected]. At the transport layer,
addresses are called port numbers, and these define the application-layer programs at the source
and destination. Port numbers are local addresses that distinguish between several programs
running at the same time. At the network-layer, the addresses are global, with the whole Internet
as the scope. A network-layer address uniquely defines the connection of a device to the Internet.
The link-layer addresses, sometimes called MAC addresses, are locally defined addresses, each
of which defines a specific host or router in a network (LAN or WAN). Figure 2.9 shows the
addressing at each layer.
Multiplexing and Demultiplexing
Since the TCP/IP protocol suite uses several protocols at some layers, we can say that we have
multiplexing at the source and demultiplexing at the destination. Multiplexing in this case means
that a protocol at a layer can encapsulate a packet from several next-higher layer protocols (one
at a time); demultiplexing means that a protocol can decapsulate and deliver a packet to several
next-higher layer protocols (one at a time).To be able to multiplex and demultiplex, a protocol
needs to have a field in its header to identify to which protocol the encapsulated packets belong.
At the transport layer, either UDP or TCP can accept a message from several application-layer
protocols. At the network layer, IP can accept a segment from TCP or a user datagram from UDP.
IP can also accept a packet from other protocols such as ICMP, IGMP, and so on. At the data-link
layer, a frame may carry the payload coming from IP or other protocols such as ARP. Figure 2.10
shows the concept of multiplexing and demultiplexing at the three upper layers.
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.