IctdipNetworking Notes
IctdipNetworking Notes
COMPUTER NETWORKS
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.
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.
Components:
A data communications system has five components.
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. 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. 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.
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.
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:
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
Multipoint
A multipoint (also called multidrop) connection is one in which more than two specific devices
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.
1. 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. To
accommodate that many links, every device on the network must have n – 1 input/output ports to
be connected to the other n - 1 stations.
Advantages:
1. 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. A mesh topology is robust. If one link becomes unusable, it does not incapacitate the entire
system.
Disadvantages:
1. Disadvantage of a mesh are related to the amount of cabling because every device must be
connected to every other device.
3. The sheer bulk of the wiring can be greater than the available space (in walls, ceilings, or
floors) can accommodate.
4. The hardware required to connect each link (I/O ports and cable) can be prohibitively
expensive.
Advantages:
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.
2. Easy to install and reconfigure.
3. Far less cabling needs to be housed, and additions, moves, and deletions involve only one
connection: between that device and the hub.
4. Other advantage 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.
Disadvantages:
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).
Characteristics of Signals:
1. Peak Amplitude
The peak amplitude of a signal is the absolute value of its highest intensity, proportional to the
energy it carries. For electric signals, peak amplitude is normally measured in volts. Figure
below shows two signals and their peak amplitudes.
I. A sine wave with a phase of 0° starts at time 0 with a zero amplitude. The amplitude is
increasing.
II. A sine wave with a phase of 90° starts at time 0 with a peak amplitude. The amplitude is
decreasing.
III. A sine wave with a phase of 180° starts at time 0 with a zero amplitude. The amplitude is
decreasing.
We send 1 bit per level in part a of the figure and 2 bits per level in part b of the figure. In
general, if a signal has L levels, each level needs log2L bits.
Bit Rate
Most digital signals are nonperiodic, and thus period and frequency are not appropriate
characteristics. Another term-bit rate is used to describe digital signals. The bit rate is the
number of bits sent in 1s, expressed in bits per second (bps). Figure 3.16 shows the bit rate for
two signals.
1. Attenuation
Attenuation means a loss of energy. When a signal, simple or composite, travels through a
medium, it loses some of its energy in overcoming the resistance of the medium. That is why a
wire carrying electric signals gets warm, if not hot, after a while. Some of the electrical energy in
the signal is converted to heat. To compensate for this loss, amplifiers are used to amplify the
signal. Attenuation is measured in terms of Decibels.
The decibel (dB) measures the relative strengths of two signals or one signal at two different
points. Note that the decibel is negative if a signal is attenuated and positive if a signal is
amplified.
dB=10log10 P2/P1
Variables PI and P2 are the powers of a signal at points 1 and 2, respectively.
2. Distortion:
Distortion means that the signal changes its form or shape. Distortion can occur in a composite
signal made of different frequencies. Each signal component has its own propagation speed
through a medium and, therefore, its own delay in arriving at the final destination. Differences in
delay may create a difference in phase if the delay is not exactly the same as the period duration.
In other words, signal components at the receiver have phases different from what they had at the
3. Noise
Noise is another cause of impairment. Several types of noise, such as thermal noise, induced
noise, crosstalk, and impulse noise, may corrupt the signal. Thermal noise is the random motion
of electrons in a wire which creates an extra signal not originally sent by the transmitter. Induced
noise comes from sources such as motors and appliances. These devices act as a sending
antenna, and the transmission medium acts as the receiving antenna. Crosstalk is the effect of
one wire on the other. One wire acts as a sending antenna and the other as the receiving antenna.
Impulse noise is a spike (a signal with high energy in a very short time) that comes from power
lines, lightning, and so on.
DIGITAL-TO-ANALOG CONVERSION
Digital-to-analog conversion is the process of changing one of the characteristics of an analog
signal based on the information in digital data. Figure 5.1 shows the relationship between the
digital information, the digital-to-analog modulating process, and the resultant analog signal.
A sine wave is defined by three characteristics: amplitude, frequency, and phase. When we vary
anyone of these characteristics, we create a different version of that wave. So, by changing one
characteristic of a simple electric signal, we can use it to represent digital data. Any of the three
characteristics can be altered in this way, giving us at least three mechanisms for modulating
digital data into an analog signal: amplitude shift keying (ASK), frequency shift keying (FSK),
and phase shift keying (PSK).
Aspects of Digital-to-Analog Conversion
Before we discuss specific methods of digital-to-analog modulation, two basic issues
must be reviewed: bit and baud rates and the carrier signal.
Data Element Versus Signal Element
Data element as the smallest piece of information to be exchanged, the bit. We also defined a
signal element as the smallest unit of a signal that is constant.
Demultiplexing Process
The demultiplexer uses a series of filters to decompose the multiplexed signal into its constituent
component signals. The individual signals are then passed to a demodulator that separates them
from their carriers and passes them to the output lines. Figure 6.5 is a conceptual illustration of
demultiplexing process.
Although WDM technology is very complex, the basic idea is very simple. We want to combine
multiple light sources into one single light at the multiplexer and do the reverse at the
demultiplexer. The combining and splitting of light sources are easily handled by a prism.
Note that in Figure 6.12 we are concerned with only multiplexing, not switching. This means that
all the data in a message from source 1 always go to one specific destination, be it 1, 2, 3, or 4.
The delivery is fixed and unvarying, unlike switching.
TRANSMISSION MEDIA
A transmission medium can be broadly defined as anything that can carry information from a
source to a destination. For example, the transmission medium for two people having a dinner
conversation is the air. The air can also be used to convey the message in a smoke signal or
semaphore. For a written message, the transmission medium might be a mail carrier, a truck, or
an airplane.
In data communications the definition of the information and the transmission medium is more
specific. The transmission medium is usually free space, metallic cable, or fiber-optic cable. The
information is usually a signal that is the result of a conversion of data from another form.
1. Twisted-Pair Cable
A twisted pair consists of two conductors (normally copper), each with its own plastic insulation,
twisted together, as shown in Figure 7.3.
One of the wires is used to carry signals to the receiver, and the other is used only as a ground
reference. The receiver uses the difference between the two. In addition to the signal sent by the
sender on one of the wires, interference (noise) and crosstalk may affect both wires and create
unwanted signals. If the two wires are parallel, the effect of these unwanted signals is not the
same in both wires because they are at different locations relative to the noise or crosstalk
sources (e,g., one is closer and the other is farther). This results in a difference at the receiver. By
twisting the pairs, a balance is maintained. For example, suppose in one twist, one wire is closer
to the noise source and the other is farther; in the next twist, the reverse is true. Twisting makes it
probable that both wires are equally affected by external influences (noise or crosstalk). This
means that the receiver, which calculates the difference between the two, receives no unwanted
signals. The unwanted signals are mostly canceled out. From the above discussion, it is clear that
the number of twists per unit of length (e.g., inch) has some effect on the quality of the cable.
Applications
Twisted-pair cables are used in telephone lines to provide voice and data channels. The local
loop-the line that connects subscribers to the central telephone office-commonly consists of
unshielded twisted-pair cables. The DSL lines that are used by the telephone companies to
Applications
Coaxial cable was widely used in analog telephone networks where a single coaxial network
could carry 10,000 voice signals. Later it was used in digital telephone networks where a single
coaxial cable could carry digital data up to 600 Mbps. However, coaxial cable in telephone
networks has largely been replaced today with fiber-optic cable. Cable TV networks also use
coaxial cables. In the traditional cable TV network, the entire network used coaxial cable. Later,
however, cable TV providers replaced most of the media with fiber-optic cable; hybrid networks
use coaxial cable only at the network boundaries, near the consumer premises. Cable TV uses
RG-59 coaxial cable. Another common application of coaxial cable is in traditional Ethernet
LANs. Because of its high bandwidth, and consequently high data rate, coaxial cable was chosen
for digital transmission in early Ethernet LANs.
As the figure shows, if the angle of incidence I (the angle the ray makes with the line
perpendicular to the interface between the two substances) is less than the critical angle, the ray
refracts and moves closer to the surface. If the angle of incidence is equal to the critical angle,
the light bends along the interface. If the angle is greater than the critical angle, the ray reflects
(makes a turn) and travels again in the denser substance. Note that the critical angle is a property
of the substance, and its value differs from one substance to another.
Optical fibers use reflection to guide light through a channel. A glass or plastic core is
surrounded by a cladding of less dense glass or plastic. The difference in density of the two
materials must be such that a beam of light moving through the core is reflected off the cladding
instead of being refracted into it. See Figure 7.11.
Applications
Fiber-optic cable is often found in backbone networks because its wide bandwidth is cost-
effective. Today, with wavelength-division multiplexing (WDM), we can transfer data at a rate
of 1600 Gbps. The SONET network provides such a backbone. Some cable TV companies use a
combination of optical fiber and coaxial cable, thus creating a hybrid network. Optical fiber
provides the backbone structure while coaxial cable provides the connection to the user premises.
This is a cost-effective configuration since the narrow bandwidth requirement at the user end
does not justify the use of optical fiber. Local-area networks such as 100Base-FX network (Fast
Ethernet) and 1000Base-X also use fiber-optic cable.
Advantages and Disadvantages of Optical Fiber
Advantages
Fiber-optic cable has several advantages over metallic cable (twisted pair or coaxial).
a. Higher bandwidth. Fiber-optic cable can support dramatically higher bandwidths (and hence
data rates) than either twisted-pair or coaxial cable. Currently, data rates and bandwidth
1. Radio Waves
Waves ranging in frequencies between 3 kHz and 1 GHz are called radio waves. Radio waves,
for the most part, are omnidirectional. When an antenna transmits radio waves, they are
propagated in all directions. This means that the sending and receiving antennas do not have to
be aligned. A sending antenna sends waves that can be received by any receiving antenna. The
omnidirectional property has a disadvantage, too. The radio waves transmitted by one antenna
are susceptible to interference by another antenna that may send signals using the same
frequency or band. Radio waves, particularly those waves that propagate in the sky mode, can
travel long distances. This makes radio waves a good candidate for long-distance broadcasting
such as AM radio. Radio waves, particularly those of low and medium frequencies, can penetrate
walls. This characteristic can be both an advantage and a disadvantage. It is an advantage
because, for example, an AM radio can receive signals inside a building. It is a disadvantage
because we cannot isolate a communication to just inside or outside a building. The radio wave
band is relatively narrow, just under 1 GHz, compared to the microwave band. When this band is
divided into sub bands, the sub bands are also narrow, leading to a low data rate for digital
communications.
2. Microwaves
Electromagnetic waves having frequencies between I and 300 GHz are called microwaves.
Microwaves are unidirectional. When an antenna transmits microwave waves, they can be
narrowly focused. This means that the sending and receiving antennas need to be aligned. The
unidirectional property has an obvious advantage. A pair of antennas can be aligned without
interfering with another pair of aligned antennas. The following describes some characteristics of
microwave propagation:
a. Microwave propagation is line-of-sight. Since the towers with the mounted antennas need to
be in direct sight of each other, towers that are far apart need to be very tall. The curvature of the
earth as well as other blocking obstacles do not allow two short towers to communicate by using
microwaves. Repeaters are often needed for long distance communication.
b. Very high-frequency microwaves cannot penetrate walls. This characteristic can be a
disadvantage if receivers are inside buildings.
SWITCHING
A network is a set of connected devices. Whenever we have multiple devices, we have the
problem of how to connect them to make one-to-one communication possible. One solution is to
make a point-to-point connection between each pair of devices (a mesh topology) or between a
central device and every other device (a star topology). These methods, however, are impractical
and wasteful when applied to very large networks. The number and length of the links require
too much infrastructure to be cost-efficient, and the majority of those links would be idle most of
the time. Other topologies employing multipoint connections, such as a bus, are ruled out
because the distances between devices and the total number of devices increase beyond the
capacities of the media and equipment.
The end systems (communicating devices) are labeled A, B, C, D, and so on, and the switches
are labeled I, II, III, IV, and V. Each switch is connected to multiple links. Traditionally, three
methods of switching have been important: circuit switching, packet switching, and message
switching. The first two are commonly used today. The third has been phased out in general
communications but still has networking applications. We can then divide today's networks into
three broad categories: circuit-switched networks, packet-switched networks, and message-
switched.
The end systems, such as computers or telephones, are directly connected to a switch. We have
shown only two end systems for simplicity. When end system A needs to communicate with end
system M, system A needs to request a connection to M that must be accepted by all switches as
well as by M itself. This is called the setup phase; a circuit (channel) is reserved on each link,
and the combination of circuits or channels defines the dedicated path. After the dedicated path
made of connected circuits (channels) is established, data transfer can take place. After all data
have been transferred, the circuits are torn down.
Three Phases
The actual communication in a circuit-switched network requires three phases: connection setup,
data transfer, and connection teardown.
In this example, all four packets (or datagrams) belong to the same message, but may travel
different paths to reach their destination. This is so because the links may be involved in carrying
packets from other sources and do not have the necessary bandwidth available to carry all the
packets from A to X. This approach can cause the datagrams of a transmission to arrive at their
destination out of order with different delays between them packets. Packets may also be lost or
dropped because of a lack of resources. In most protocols, it is the responsibility of an upper-
layer protocol to reorder the datagrams or ask for lost datagrams before passing them on to the
application. The datagram networks are sometimes referred to as connectionless networks. The
term connectionless here means that the switch (packet switch) does not keep information about
the connection state. There are no setup or teardown phases. Each packet is treated the same by a
switch regardless of its source or destination.
b. VIRTUAL-CIRCUIT NETWORKS
A virtual-circuit network is a cross between a circuit-switched network and a datagram network.
It has some characteristics of both.
1. Parallel Transmission
Binary data, consisting of 1s and 0s, may be organized into groups of n bits each. Computers
produce and consume data in groups of bits much as we conceive of and use spoken language in
the form of words rather than letters. By grouping, we can send data n bits at a time instead of 1.
This is called parallel transmission. The mechanism for parallel transmission is a conceptually
simple one: Use n wires to send n bits at one time. That way each bit has its own wire, and all n
bits of one group can be transmitted with each clock tick from one device to another. Figure 4.32
shows how parallel transmission works for n =8. Typically, the eight wires are bundled in a cable
with a connector at each end. The advantage of parallel transmission is speed. All else being
equal, parallel transmission can increase the transfer speed by a factor of n over serial
transmission.
But there is a significant disadvantage: cost. Parallel transmission requires n communication
lines just to transmit the data stream. Because this is expensive, parallel transmission is usually
limited to short distances.
The advantage of serial over parallel transmission is that with only one communication channel,
serial transmission reduces the cost of transmission over parallel by roughly a factor of n. Since
communication within devices is parallel, conversion devices are required at the interface
between the sender and the line (parallel-to-serial) and between the line and the receiver (serial-
to-parallel).
Serial transmission occurs in one of three ways: asynchronous, synchronous, and isochronous.
Figure 10.21 shows one immediate benefit; a 7-bit pattern can be replaced by three terms. The
benefit is even more conspicuous when we have a polynomial such as x23 + X3 + 1. Here the bit
pattern is 24 bits in length (three Is and twenty-one Os) while the polynomial is just three terms.
Figure 10.10 shows a possible structure of an encoder (at the sender) and a decoder
(at the receiver). The encoder uses a generator that takes a copy of a 4-bit dataword (ao, aI' a2'
and a3) and generates a parity bit roo The dataword bits and the parity bit create the 5-bit
codeword. The parity bit that is added makes the number of Is in the codeword even.
If the number of 1s is even, the result is 0; if the number of 1s is odd, the result is 1. In both
cases, the total number of 1s in the codeword is even. The sender sends the codeword which may
be corrupted during transmission. The receiver receives a 5-bit word. The checker at the receiver
does the same thing as the generator in the sender with one exception: The addition is done over
all 5 bits. The result, which is called the syndrome, is just 1 bit. The syndrome is 0 when the
number of Is in the received codeword is even; otherwise, it is 1.
The syndrome is passed to the decision logic analyzer. If the syndrome is 0, there is no error in
the received codeword; the data portion of the received codeword is accepted as the dataword; if
the syndrome is 1, the data portion of the received codeword is discarded. The dataword is not
created.
HDLC
High-level Data Link Control (HDLC) is a bit-oriented protocol for communication over point-
to-point and multipoint links.
Configurations and Transfer Modes
HDLC provides two common transfer modes that can be used in different configurations: normal
response mode (NRM) and asynchronous balanced mode (ABM).
Normal Response Mode
In normal response mode (NRM), the station configuration is unbalanced. We have one primary
station and multiple secondary stations. A primary station can send commands; a secondary
station can only respond. The NRM is used for both point-to-point and multiple-point links, as
shown in Figure 11.25.
Asynchronous Balanced Mode
In asynchronous balanced mode (ABM), the configuration is balanced. The link is point-to-point,
and each station can function as a primary and a secondary (acting as peers), as shown in Figure
11.26. This is the common mode today.
Fields
Let us now discuss the fields and their use in different frame types.
o Flag field. The flag field of an HDLC frame is an 8-bit sequence with the bit pattern 01111110
that identifies both the beginning and the end of a frame and serves as a synchronization pattern
for the receiver.
o Address field. The second field of an HDLC frame contains the address of the secondary
station. If a primary station created the frame, it contains a to address. If a secondary creates the
frame, it contains a from address. An address field can be 1 byte or several bytes long, depending
on the needs of the network. One byte can identify up to 128 stations (l bit is used for another
purpose). Larger networks require multiple-byte address fields. If the address field is only 1 byte,
the last bit is always a 1. If the address is more than 1 byte, all bytes but the last one will end
with 0; only the last will end with 1. Ending each intermediate byte with 0 indicates to the
receiver that there are more address bytes to come.
o Control field. The control field is a 1- or 2-byte segment of the frame used for flow and error
control. The interpretation of bits in this field depends on the frame type.
o Information field. The information field contains the user's data from the network layer or
management information. Its length can vary from one network to another.
o FCS field. The frame check sequence (FCS) is the HDLC error detection field.
The OSI model is composed of seven ordered layers: physical (layer 1), data link (layer 2),
network (layer 3), transport (layer 4), session (layer 5), presentation (layer 6), and application
(layer 7). Figure below shows the layers involved when a message is sent from device A to
device B. As the message travels from A to B, it may pass through many intermediate nodes.
These intermediate nodes usually involve only the first three layers of the OSI model.
1. Physical Layer
The physical layer coordinates the functions required to carry a bit stream over a physical
medium. It deals with the mechanical and electrical specifications of the interface and
transmission medium. It also defines the procedures and functions that physical devices and
interfaces have to perform for transmission to occur.
CONNECTING DEVICES
1. Repeaters
A repeater is a device that operates only in the physical layer. Signals that carry information
within a network can travel a fixed distance before attenuation endangers the integrity of the
data. A repeater receives a signal and, before it becomes too weak or corrupted, regenerates the
original bit pattern. The repeater then sends the refreshed signal. A repeater can extend the
physical length of a LAN, as shown in Figure 15.2.
A hub is a physical layer device. They do not have a link layer address and they do not check the
link layer address of the received frame. They just regenerate the corrupted bits and send them
out from every port.
4. Routers
A router is a three-layer device that routes packets based on their logical addresses (host-to-host
addressing). A router normally connects LANs and WANs in the Internet and has a routing table
that is used for making decisions about the route. The routing tables are normally dynamic and
are updated using routing protocols. Figure 15.11 shows a part of the Internet that uses routers to
connect LANs and WANs.
Unicast, Multicast, and Broadcast Addresses: A source address is always a unicast address-the
frame comes from only one station. The destination address, however, can be unicast, multicast,
or broadcast. If the least significant bit of the first byte in a destination address is 0, the address is
unicast; otherwise, it is multicast. A unicast destination address defines only one recipient; the
relationship between the sender and the receiver is one-to-one. A multicast destination address
defines a group of addresses; the relationship between the sender and the receivers is one-to-
many. The broadcast address is a special case of the multicast address; the recipients are all the
stations on the LAN. A broadcast destination address is forty-eight 1's.
For Example:
a)- 4A:30:10:21:1O:1A - This is a unicast address because A in binary is 1010 (even).
b)- 47:20:1B:2E:08:EE - This is a multicast address because 7 in binary is 0111 (odd).
c)- FF:FF:FF:FF:FF:FF - This is a broadcast address because all digits are F's.
The way the addresses are sent out on line is different from the way they are written in
hexadecimal notation. The transmission is left-to-right, byte by byte; however, for each byte, the
least significant bit is sent first and the most significant bit is sent last. This means that the bit
that defines an address as unicast or multicast arrives first at the receiver.
2. ELECTRONIC MAIL
One of the most popular Internet services is electronic mail (e-mail). The designers of the
Internet probably never imagined the popularity of this application program. At the beginning of
the Internet era, the messages sent by electronic mail were short and consisted of text only; they
let people exchange quick memos. Today, electronic mail is much more complex. It allows a
message to include text, audio, and video. It also allows one message to be sent to one or more
recipients.
Architecture
User Agent
The first component of an electronic mail system is the user agent. It provides service to the user
to make the process of sending and receiving a message easier.
Services Provided by a User Agent
A user agent is a software package (program) that composes, reads, replies to, and forwards
messages. It also handles mailboxes. Figure 26.11 shows the services of a typical user agent.
Composing Messages
A user agent helps the user compose the e-mail message to be sent out. Most user agents provide
a template on the screen to be filled in by the user. Some even have a built-in editor that can do
Commands: Commands are sent from the client to the server. The format of a command is
shown in Figure 26.18. It consists of a keyword followed by zero or more arguments. SMTP
defines 14 commands. The first five are mandatory; every implementation must support these
five commands. The next three are often used and highly recommended. The last six are seldom
used.
4. POP3
Post Office Protocol, version 3 (POP3) is simple and limited in functionality. The client POP3
software is installed on the recipient computer; the server POP3 software is installed on the mail
server. Mail access starts with the client when the user needs to download e-mail from the
mailbox on the mail server. The client opens a connection to the server on TCP port 110. It then
sends its user name and password to access the mailbox. The user can then list and retrieve the
mail messages, one by one.
POP3 has two modes: the delete mode and the keep mode. In the delete mode, the mail is deleted
from the mailbox after each retrieval. In the keep mode, the mail remains in the mailbox after
retrieval. The delete mode is normally used when the user is working at her permanent computer
and can save and organize the received mail after reading or replying. The keep mode is
normally used when the user accesses her mail away from her primary computer (e.g., a laptop).
The mail is read but kept in the system for later retrieval and organizing.
6. Web-Based Mail
E-mail is such a common application that some websites today provide this service to anyone
who accesses the site. Two common sites are Hotmail and Yahoo. The idea is very simple. Mail
transfer from Alice's browser to her mail server is done through HTTP. The transfer of the
message from the sending mail server to the receiving mail server is still through SMTP. Finally,
the message from the receiving server (the Web server) to Bob's browser is done through HTTP.
The last phase is very interesting. Instead of POP3 or IMAP4, HTTP is normally used. When
Bob needs to retrieve his e-mails, he sends a message to the website (Hotmail, for example). The
website sends a form to be filled in by Bob, which includes the log-in name and the password. If
the log-in name and password match, the e-mail is transferred from the Web server to Bob's
browser in HTML format.
7. FTP
File Transfer Protocol (FTP) is the standard mechanism provided by TCP/IP for copying a file
from one host to another. Although transferring files from one system to another seems simple
and straightforward, some problems must be dealt with first. For example, two systems may use
different file name conventions. Two systems may have different ways to represent text and data.
The control connection remains connected during the entire interactive FTP session. The data
connection is opened and then closed for each file transferred. It opens each time commands that
8. HTTP
The Hypertext Transfer Protocol (HTTP) is a protocol used mainly to access data on the World
Wide Web. HTTP functions as a combination of FTP and SMTP. It is similar to FTP because it
transfers files and uses the services of TCP. However, it is much simpler than FTP because it
uses only one TCP connection. There is no separate control connection; only data are transferred
between the client and the server. HTTP is like SMTP because the data transferred between the
client and the server look like SMTP messages. In addition, the format of the messages is
controlled by MIME-like headers. Unlike SMTP, the HTTP messages are not destined to be read
by humans; they are read and interpreted by the HTTP server and HTTP client (browser). SMTP
messages are stored and forwarded, but HTTP messages are delivered immediately. The
commands from the client to the server are embedded in a request message. The contents of the
requested file or other information are embedded in a response message. HTTP uses the services
of TCP on well-known port 80.
a. Request type. This field is used in the request message. In version 1.1 of HTTP, several
request types are defined. The request type is categorized into methods as defined in Table 27.1.