0% found this document useful (0 votes)
10 views79 pages

CN Module1 23

The document provides an introduction to computer networks, detailing various types of networks including Personal Area Networks (PANs), Local Area Networks (LANs), Metropolitan Area Networks (MANs), and Wide Area Networks (WANs). It discusses network hardware, transmission technologies, and the principles of reliable data transfer, focusing on protocols like TCP and UDP. Additionally, it covers the structure of UDP segments and the importance of checksums for error detection.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views79 pages

CN Module1 23

The document provides an introduction to computer networks, detailing various types of networks including Personal Area Networks (PANs), Local Area Networks (LANs), Metropolitan Area Networks (MANs), and Wide Area Networks (WANs). It discusses network hardware, transmission technologies, and the principles of reliable data transfer, focusing on protocols like TCP and UDP. Additionally, it covers the structure of UDP segments and the importance of checksums for error detection.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 79

Module 1

Introduction to Networks

‘‘Computer network’’ to mean a


collection of autonomous
computers interconnected by a
single technology. Two computers
are said to be interconnected if
they are able to exchange
information.
Network Hardware
•There are two types of transmission technology:
a) Broadcast links b) Point to point links
•Point to point links connect individual pairs of machines.
•Point-to-point transmission with exactly one sender and
exactly one receiver is sometimes called Unicasting.
•In a broadcast network, the communication channel is
shared by all the machines on the network; packets sent by any
machine are received by all the others.
•An address field within each packet specifies the intended
recipient. Upon receiving a packet, a machine checks the
address field. If the packet is intended for the receiving
machine, that machine processes the packet; if the packet is
intended
04/14/25
for some other machine, it is just ignored.
• Broadcast systems usually also allow the possibility of
addressing a packet to all destinations by using a special
code in the address field.
• When a packet with this code is transmitted, it is received
and processed by every machine on the network. This
mode of operation is called broadcasting.
• Some broadcast systems also support transmission to a
subset of the machines, which known as multicasting.

04/14/25
Classifying networks is scale

04/14/25
• PANs (Personal Area Networks) let devices communicate over
the range of a person. A common example is a wireless network
that connects a computer with its peripherals. Almost every
computer has an attached monitor, keyboard, mouse, and printer.
• Some companies got together to design a short-range wireless
network called Bluetooth to connect these components without
wires. The idea is that if your devices have Bluetooth, then you
need no cables.

04/14/25
• Bluetooth networks use the master-slave paradigm of
Fig. 1-7. The system unit (the PC) is normally the master,
talking to the mouse, keyboard, etc., as slaves.
• The master tells the slaves what addresses to use, when
they can broadcast, how long they can transmit, what
frequencies they can use.
• Bluetooth can be used in other settings, too. It is often
used to connect a headset to a mobile phone without
cords and it can allow your digital music player to
connect to your car merely being brought within range.
• A completely different kind of PAN is formed when an
embedded medical device such as a pacemaker, insulin
pump, or hearing aid talks to a user-operated remote
control.
04/14/25
Local Area Network
• A LAN is a privately owned network that operates within
and nearby a single building like a home, office or
factory.
• LANs are widely used to connect personal computers and
consumer electronics to let them share resources (e.g.,
printers) and exchange information.
• When LANs are used by companies, they are called
enterprise networks. Wireless LANs are very popular
these days, especially in homes, older office buildings,
cafeterias, and other places where it is too much trouble
to install cables.
• In these systems, every computer has a radio modem an
antenna that it uses to communicate with other computers.
04/14/25
AP (Access Point), wireless router, or base station, relays packets
between the wireless computers and also between them and the
Internet.
There is a standard for wireless LANs called IEEE 802.11,
popularly known as WiFi, which has become very widespread. It
04/14/25
runs at speeds anywhere from 11 to hundreds of Mbps.
• The topology of many wired LANs is built from point-to-
point links. IEEE 802.3, popularly called Ethernet, is, by
far, the most common type of wired LAN.
• Fig. 1-8(b) shows a sample topology of switched
Ethernet. Each computer speaks the Ethernet protocol and
connects to a box called a switch with a point-to-point
link. Hence the name.
• A switch has multiple ports, each of which can connect to
one computer. The job of the switch is to relay packets
between computers that are attached to it, using the
address in each packet to determine which computer to
send it to.
• Both wireless and wired broadcast networks can be
divided into static and dynamic designs, depending on
04/14/25
how the channel is allocated.
• A typical static allocation would be to divide time into discrete
intervals and use a round-robin algorithm, allowing each
machine to broadcast only when its time slot comes up.
• Static allocation wastes channel capacity when a machine has
nothing to say during its allocated slot, so most systems
attempt to allocate the channel dynamically (i.e., on demand).
• Dynamic allocation methods for a common channel are either
centralized or decentralized.
• In the centralized channel allocation method, there is a single
entity, for example, the base station in cellular networks,
which determines who goes next. It might do this by accepting
multiple packets and prioritizing them according to some
internal algorithm.
• In the decentralized channel allocation method, there is no
central entity; each machine must decide for itself whether to
transmit.
04/14/25
• If home network is considered as another LAN, it is more
likely to have different properties than other networks.
1. The networked devices have to be very easy to install.
2. The network and devices have to be foolproof in
operation.
3. Low price is essential for success.
4. It must be possible to start out with one or two devices
and expand the reach of the network gradually. This
means no format wars.
5. Security and Reliability will be very important.
04/14/25
Metropolitan Area Network
•A MAN covers a city. The best-known examples of MANs
are the cable television networks available in many cities.

04/14/25
• A WAN (Wide Area Network) spans a large geographical area, often a
country or continent.

04/14/25
•The WAN in Fig. is a network that connects offices in
Perth, Melbourne, and Brisbane. Each of these offices
contains computers intended for running user (i.e.,
application) programs and called as hosts.
•The rest of the network that connects these hosts is then
called the communication subnet, or just subnet for short.
The job of the subnet is to carry messages from host to
host, just as the telephone system carries words from
speaker to listener.
•In most WANs, the subnet consists of two distinct
components: transmission lines and switching elements.
Transmission lines move bits between machines. They can
be made of copper wire, optical fiber, or even radio links.
04/14/25
• Switching elements, or just switches, are specialized
computers that connect two or more transmission lines.
• When data arrive on an incoming line, the switching
element must choose an outgoing line on which to forward
them. These switching computers are called router is now
most commonly used.
• The routers will usually connect different kinds of
networking technology.
• WANs will in fact be internetworks, or composite networks
that are made up of more than one network.

04/14/25
• Virtual Private Network, a VPN has the usual advantage
of virtualization, which is that it provides flexible reuse of a
resource (Internet connectivity).
• A VPN also has the usual disadvantage of virtualization,
which is a lack of control over the underlying resources.

04/14/25
The second variation is that the subnet may be run by a different company.
The subnet operator is known as a network service provider and the offices
are its customers.
The subnet operator will connect to other customers too, as long as they can
pay and it can provide service.
The subnet operator will also connect to other networks that are part of the
Internet. Such a subnet operator is called an ISP (Internet Service Provider)
04/14/25
and the subnet is an ISP network.
• In most WANs, the network contains many transmission lines, each
connecting a pair of routers. If two routers that do not share a
transmission line wish to communicate, they must do this indirectly,
via other routers.
• There may be many paths in the network that connect these two
routers. How the network makes the decision as to which path to use
is called the routing algorithm.
• Other kinds of WANs make heavy use of wireless technologies. In
satellite systems, each computer on the ground has an antenna through
which it can send data to and receive data from to a satellite in orbit.
• All computers can hear the output from the satellite, and in some
cases they can also hear the upward transmissions of their fellow
computers to the satellite as well.
• The cellular telephone network is another example of a WAN that
uses wireless technology. This system has already gone through three
generations and a fourth one is on the horizon.
04/14/25
• The first generation was analog and for voice only.
• The second generation was digital and for voice
only.
• The third generation is digital and is for both voice
and data.
• Each cellular base station covers a distance much
larger than a wireless LAN, with a range measured
in kilometers rather than tens of meters.
• The base stations are connected to each other by a
backbone network that is usually wired.
• The data rates of cellular networks are often on the
order of 1 Mbps, much smaller than a wireless LAN
that can range up to on the order of 100 Mbps.

04/14/25
A collection of interconnected networks is called an internetwork or
internet. These terms will be used in a generic sense, in contrast to the
worldwide Internet (which is one specific internet), which we will
always capitalize.
The Internet uses ISP networks to connect enterprise networks, home
networks, and many other networks.
First, if different organizations have paid to construct different parts of
the network and each maintains its part, we have an internetwork rather
than a single network.
Second, if the underlying technology is different in different parts (e.g.,
broadcast versus point-to-point and wired versus wireless), we probably
have an internetwork.
The general name for a machine that makes a connection between two or
more networks and provides the necessary translation, both in terms of
hardware and software, is a gateway

04/14/25
• Why an application developer would ever choose to build an
application over UDP rather than over TCP. Isn’t TCP always
preferable, since TCP provides a reliable data transfer service, while
UDP does not?
• Many applications are better suited for UDP for the following
reasons:
– UDP immediately pass segment, where as TCP not
– No connection establishment
– No connection state. (like- buffers, congestion-control parameters, and sequence
and acknowledgment number parameters)
– Small packet header overhead: The TCP segment has 20 bytes of header
overhead in every segment, whereas UDP has only 8 bytes of overhead.

04/14/25
3.3.1 UDP Segment Structure

04/14/25
• The UDP header has only four fields, each consisting of two bytes

1) Source port number field


2) Destination port number field
3) Checksum is used by the receiving host to check whether errors have
been introduced into the segment.
4) The length field specifies the length of the UDP segment, including
the header, in bytes

04/14/25
3.3.2 UDP Checksum
•The UDP checksum provides for error detection. That is, the checksum
is used to determine whether bits within the UDP segment have been
altered (for example, by noise in the links or while stored in a router) as
it moved from source to destination.

•UDP at the sender side performs the 1s complement of the sum of all
the 16-bit words in the segment, with any overflow encountered during
the sum being wrapped.
Example, suppose that we have the following three 16-bit words:
–0 1 1 0 0 1 1 0 0 1 1 0 0 0 0 0
–0 1 0 1 0 1 0 1 0 0 1 1 0 1 0 1
–1 0 0 0 1 1 1 1 0 0 0 0 1 1 0 0
04/14/25
• The sum of first two of these 16-bit words is
0110011001100000
0101010101010101
-----------------------------------
1011101110110101

• Adding the third word to the above sum gives


1011101110110101
1000111100001100
-----------------------------------
0100101011000010
04/14/25
• the 1s complement of the sum 0100101011000010 is
1011010100111101, which becomes the checksum.

• At the receiver, all four 16-bit words are added, including the
checksum.
• If no errors are introduced into the packet, then clearly the sum
at the receiver will be 1111111111111111.
• If one of the bits is a 0, then we know that errors have been
introduced into the packet.

04/14/25
Chapter 3 outline

3.1 transport-layer 3.5 connection-oriented


services transport: TCP
3.2 multiplexing and  segment structure
demultiplexing  reliable data transfer
 flow control
3.3 connectionless
 connection management
transport: UDP
3.4 principles of reliable 3.6 principles of congestion
data transfer control
3.7 TCP congestion control

04/14/25
3.4 Principles of Reliable Data Transfer

•Figure 3.8 illustrates the framework for our study of reliable


data transfer.
•The service abstraction provided by the upper-layer entities is
that of a reliable channel through which data can be
transferred.
•With a reliable channel, no transferred data bits are corrupted
(flipped from 0 to 1, or vice versa) or lost, and all are
delivered in the order in which they were sent.
•This is precisely the service model offered by TCP to the
Internet applications that invoke it.

04/14/25
04/14/25
04/14/25
04/14/25
Reliable data transfer: getting started

rdt_send(): called from above, deliver_data(): called


(e.g., by app.). Passed by rdt to deliver data to
data to upper
deliver to receiver upper
layer

send receive
side side

udt_send(): called by rdt, rdt_rcv(): called when packet


to transfer packet over arrives on rcv-side of channel
unreliable channel to
receiver
04/14/25
04/14/25
• Figure 3.8(b) illustrates the interfaces for our data transfer protocol.

• The sending side of the data transfer protocol will be invoked from
above by a call to rdt_send().
• It will pass the data to be delivered to the upper layer at the receiving
side.

• On the receiving side, rdt_rcv() will be called when a packet arrives


from the receiving side of the channel.
• When the rdt protocol wants to deliver data to the upper layer, it will
do so by calling deliver_data().

04/14/25
3.4.1 Building a Reliable Data Transfer Protocol

•Reliable Data Transfer on a perfectly reliable channel: rdt1.0


•The finite-state machine (FSM) definitions for the rdt1.0 sender and
receiver are shown in Figure 3.9.
•The FSM in Figure 3.9(a) defines the operation of the sender, while the
FSM in Figure 3.9(b) defines the operation of the receiver.

Figure 3.9 rdt1.0 – A protocol for a completely reliable channel


04/14/25
Figure 3.9 rdt1.0 – A protocol for a completely reliable channel

04/14/25
• The event causing the transition is shown above the horizontal line
labeling the transition, and the actions taken when the event occurs
are shown below the horizontal line.
• When no action is taken on an event, or no event occurs and an
action is taken, we’ll use Λ the symbol below or above the
horizontal.

• The sending side of rdt simply accepts data from the upper layer via
the rdt_send(data) event, creates a packet containing the data (via the
action make_pkt(data)) and sends the packet into the channel.
• On the receiving side of rdt, receives a packet from the underlying
channel via the rdt_rcv(packet) event, removes the data from the
packet (via the action extract (packet, data)) and passes the data up to
the upper layer (via the action deliver_data(data)).

04/14/25
• Reliable Data Transfer over a Channel with Bit Errors: rdt2.0

In a computer network setting, reliable data transfer protocols based


retransmission are known as ARQ (Automatic Repeat reQuest)
protocols.
Three additional protocol capabilities are required in ARQ
protocols to handle the presence of bit errors:
• Error detection
• Receiver feedback
• Retransmission

04/14/25
04/14/25
04/14/25
04/14/25
04/14/25
Chapter 3 outline

3.1 transport-layer services 3.5 connection-oriented


3.2 multiplexing and transport: TCP
demultiplexing  segment structure
 reliable data transfer
3.3 connectionless transport:
 flow control
UDP
 connection management
3.4 principles of reliable data
transfer 3.6 principles of congestion
control
3.7 TCP congestion control

04/14/25
TCP: Overview RFCs: 793,1122,1323, 2018,
2581

• point-to-point:  full duplex data:


– one sender, one receiver  bi-directional data flow in
• reliable, in-order byte same connection
 MSS: maximum segment
steam:
size
– no “message boundaries”
 connection-oriented:
• pipelined:
 handshaking (exchange of
– TCP congestion and flow
control msgs) inits sender,
control set window size receiver state before data
exchange
 flow controlled:
 sender will not overwhelm
receiver
04/14/25
04/14/25
3.5.2 TCP segment structure
32 bits
URG: urgent data counting
(generally not used) source port # dest port #
by bytes
sequence number of data
ACK: ACK #
valid acknowledgement number (not segments!)
head not
PSH: push data now len used
UAP R S F receive window
(generally not used) # bytes
checksum Urg data pointer
rcvr willing
RST, SYN, FIN: to accept
options (variable length)
connection estab
(setup, teardown
commands)
application
Internet data
checksum (variable length)
(as in UDP)

04/14/25
04/14/25
• Sequence Numbers and Acknowledgment Numbers

The acknowledgment number that Host A puts in its


segment is the sequence number of the next byte Host A
is expecting from Host B.

04/14/25
• Host A rcvd all bytes 0 to 535 (0-999) from B
• A is waiting for 536 byte to rcv
• Host A puts ack 536

04/14/25
3.5.3 Round-Trip Time Estimation and
Timeout
What is the length of the timeout interval?
Soln:
The timeout should be larger than the connection’s round-trip time
(RTT), that is, the time from when a segment is sent until it is
acknowledged. Otherwise, unnecessary retransmissions would be
sent.

• Estimating the Round-Trip Time

0.125
04/14/25
Fig: RTT samples and RTT estimates

04/14/25
3.5.4 Reliable Data Transfer

• TCP creates rdt service on top of IP’s unreliable


service
– pipelined segments
– cumulative acks
– single retransmission timer
• retransmissions triggered by:
– timeout events
– duplicate acks

04/14/25
04/14/25
TCP sender events:
data rcvd from app: timeout:
 create segment with seq #  retransmit segment that
 seq # is byte-stream caused timeout
number of first data byte in  restart timer
segment ack rcvd:
 start timer if not already  if ack acknowledges
running previously unacked
 think of timer as for segments
oldest unacked segment  update what is known to
 expiration interval: be ACKed
TimeOutInterval  start timer if there are
still unacked segments

04/14/25
TCP: retransmission
scenarios
Host A Host B Host A Host B

SendBase=92
Seq=92, 8 bytes of data Seq=92, 8 bytes of data

Seq=100, 20 bytes of data


timeo

timeo
ACK=100
X
ut

ut
ACK=100
ACK=120

Seq=92, 8 bytes of data Seq=92, 8


SendBase=100 bytes of data
SendBase=120
ACK=100
ACK=120

SendBase=120

lost ACK scenario premature timeout


04/14/25
TCP: retransmission
scenarios
Host A Host B

Seq=92, 8 bytes of data

Seq=100, 20 bytes of data


ACK=100
timeo

X
ut

ACK=120

Seq=120, 15 bytes of data

cumulative ACK
04/14/25
Fig: Retransmission due to a lost acknowledgment
04/14/25
Premature timeout

04/14/25
A cumulative acknowledgment avoids retransmission of the
first segment
04/14/25
Doubling the Timeout Interval
Each time TCP retransmits, it sets the next timeout interval to twice the
previous value, rather than deriving it from the last EstimatedRTT

Fast Retransmit
Retransmitting the missing segment before that segment’s timer expires.

04/14/25
04/14/25
3.5.5 Flow Control

• A speed-matching service.

• TCP provides a flow-control service to its applications to


eliminate the possibility of the sender overflowing the
receiver’s buffer.

04/14/25
LastByteRead

LastByteRcvd

04/14/25
• Because TCP is not permitted to overflow the allocated buffer, we
must have
LastByteRcvd – LastByteRead <= RcvBuffer

• The receive window, denoted rwnd is set to the amount of spare


room in the buffer:
rwnd = RcvBuffer – [LastByteRcvd – LastByteRead]

04/14/25
3.5.6 TCP Connection Management

Let’s first take a look at how a TCP connection is established.

•Suppose a process running in one host (client) wants to initiate


a connection with another process in another host (server). The
client application process first informs the client TCP that it
wants to establish a connection to a process in the server.
•Step-1
•Step-2
•Step-3

04/14/25
04/14/25
04/14/25
Life cycle of a TCP connection
• During the life of a TCP connection, the TCP protocol running in
each host makes transitions through various TCP states.
• Figure 3.41 illustrates a typical sequence of TCP states that are
visited by the client TCP.
• The client TCP begins in the CLOSED state.

04/14/25
04/14/25
04/14/25
Principles of TCP Congestion Control

The Causes and the Costs of Congestion

Scenario 1: Two Senders, a Router with Infinite Buffers

04/14/25
04/14/25
Scenario 2: Two Senders and a Router with Finite Buffers

04/14/25
04/14/25
Network-Assisted Congestion-Control Example:

ATM ABR Congestion Control


Asynchronous transfer mode (ATM) available bit-rate (ABR)

ATM ABR—a protocol that takes a network-assisted approach toward


congestion control.

• explicit forward congestion indication (EFCI) bit.


04/14/25 • congestion indication (CI) bit
• no increase (NI) bit
04/14/25
Slow Start

04/14/25
04/14/25
04/14/25

You might also like