0% found this document useful (0 votes)
62 views21 pages

CS6551

The document defines key concepts in computer networks including defining a computer network, comparing simplex and duplex communication, assessing network performance and reliability, line configurations, common network topologies like mesh, star, bus and ring, classifying different types of networks, listing advantages of layering, defining protocols, protocol graphs, network architectures, and briefly describing the seven layers of the OSI model.

Uploaded by

valarmathi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
62 views21 pages

CS6551

The document defines key concepts in computer networks including defining a computer network, comparing simplex and duplex communication, assessing network performance and reliability, line configurations, common network topologies like mesh, star, bus and ring, classifying different types of networks, listing advantages of layering, defining protocols, protocol graphs, network architectures, and briefly describing the seven layers of the OSI model.

Uploaded by

valarmathi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21

CS6651-Computer Networks 1.

Define computer network.


Computer network is a connection of autonomous computers and network devices for:
Resource sharing (data/devices) in an efficient manner
Communication amongst them.
Compare simplex and duplex communication with example.
In simplex mode, the communication is unidirectional (Eg: keyboard, monitor).
In half-duplex mode, each station can both transmit and receive, but not simultaneously
(Eg. walkie-talkie).
In full-duplex (also called duplex), both stations can transmit and receive simultaneously
(Eg. telephone network).

List the criteria based on which a network can be assessed.


Performance is based on its throughput (no. of packets delivered) and delay.
Reliability is how much the network is fault tolerant.
Security includes preventing unauthorized access and recovery from breaches.
What are the two types of line configuration?
A point-to-point connection provides a dedicated link between two nodes.
In a multipoint connection, more than two nodes share a single link, i.e., bandwidth is
shared amongst the nodes.

State any two topologies in which a network can be organized.

Mesh Star Bus Ring


Mesh: Each device has a dedicated point-to-point link to every other device. It is robust
and secure. Installation is difficult and expensive n(n-1) link for n node.
Star: Each device has a dedicated point-to-point link only to a central controller called a
hub. All communication goes via the hub. It is less expensive and robust. A failure in the
hub makes the network non-functional. Eg; LAN
Bus: It is multi-point and signal gets weak as it travels through the long cable that acts as
backbone. A fault in the bus stops the entire transmission

Vijai Anand cseannauniv.blogspot.com


CS6651-Computer Networks 1.2

Ring: Each device has a dedicated point-to-point connection with the devices on either
side of it. A break in the ring can disable the entire network due to unidirectional traffic.
Classify LAN, WAN, MAN, SAN and Internetwork.
Local Area Network (LAN) is privately owned and links the devices in a single office,
building, or campus. The LAN size is limited to a few kilometers. A LAN will use only
one type of transmission medium. The speed of LAN is in the range 10–1000 Mbps.
Wide Area Network (WAN) provides long-distance transmission of data, image, audio,
and video over large geographic areas that may comprise a country / continent.
Metropolitian Area Network (MAN) is a network with a size between a LAN and a
WAN. It normally covers the area inside a town or a city. It is designed for customers
who need a high-speed connectivity to the Internet, and have endpoints spread over a city
or part of city.
When two or more independent networks are connected, it becomes an internetwork or
internet.
Storage area network (SAN) is confined to a single room and connect the various
components of a large computing system. For example, fiber channel is used to connect
high-performance computing systems to storage servers.
List the advantages of layering.
It decomposes the problem of building a network into more manageable components.
It provides a more modular design. To add a new service, then it is only needed to modify
the functionality at one layer, reusing the functions at all the other layers.
Uses abstraction to hide complexity of network from application.
Define protocol.
The abstract objects that make up the layers of a network system are called protocols.
Each protocol defines two different interfaces.
o Service interface that specifies the set of operations
o Peer-to-peer interface for messages to be exchanged amongst peers
Protocol is a set of rules that govern communications between devices.
What is a protocol graph?
The suite of protocols that make up a network system is represented as a protocol graph.
The nodes correspond to protocols and edges represent a depends-on relation.
Define network architecture.
Set of rules governing form and content of protocol graph is called network architecture.
Network architecture guides the design and implementation of computer networks.
Two commonly used architecture are
o OSI Architecture
o Internet or TCP/IP architecture
What purpose do header and trailer serve?
A layer communicates control information to its peer, instructing it how to handle the
message when it is received by attaching a header in front of the message.
The trailer usually contains error control information.
A header/trailer is a small data structure consists of a few bytes.

Vijai Anand cseannauniv.blogspot.com


CS6651-Computer Networks 1.3

Brief the terms unicast, multicast and broadcast.


The different types of addressing are unicast (one-to-one communication), multicasting
(communicating to all members of a group) and broadcast (sending to all nodes on the network).

What is encapsulation.
As data passes through a layer, it attaches its header and then passes it to the next layer.
For the next layer, the data and header of the previous layer is encapsulated as a unit.
It then attaches its header and passes to the next layer and so on.
Discuss in detail about the layers of OSI model with a neat diagram.
The ISO defined a common way to connect computers, called the Open Systems
Interconnection (OSI) architecture. (eg. public X.25 network).
It defines partitioning of network functionality into seven layers.
The bottom three layers, i.e., physical, data link and network are implemented on all
nodes on the network including switches.

Physical Layer
It coordinates the functions required to carry a bit stream over a physical medium.
Representation of bits—To be transmitted, bits must be encoded into signals, electrical or
optical. The physical layer defines the type of encoding.
Data rate—It defines the transmission rate (number of bits sent per second).
Physical topology—It defines how devices are connected (mesh, star, ring, bus or hybrid)
to make a network.
Transmission mode—The physical layer also defines the direction of transmission
between two devices: simplex, half-duplex, or full-duplex

Data Link Layer


The data link layer transforms a raw transmission facility to a reliable link.

Vijai Anand cseannauniv.blogspot.com


CS6651-Computer Networks 1.4

Framing—The bit stream is divided into manageable data units called frames.
Physical addressing—A header is added to contain physical address of sender and
receiver of the frame.
Flow control—If receiving rate is less than the transmission rate, data link layer imposes
a flow control mechanism to avoid overwhelming the receiver.
Error control—Redundant information is added as trailer to detect and retransmit
damaged/lost frames and to recognize duplicate frames.
Access control—When two or more devices are connected to the same link, link layer
protocols determines which device has control over the link at any given time.

Network Layer
It is responsible for source-to-destination delivery of a data unit called packet.
Logical addressing—The packet is identified across the network using the logical
addressing system provided by network layer and is used to identify the end systems.
Routing—The connecting devices (routers or switches) prepare routing table to send
packets to their destination.

Transport Layer
Transport layer is responsible for process-to-process delivery of the entire message.
Service-point addressing—It includes a service-point address or port address so that a
process from one computer communicates to a specific process on the other computer.
Segmentation and reassembly—A message is divided into transmittable segments, each
containing a sequence number. These numbers enable the transport layer to reassemble
the message correctly at the destination and to identify which were lost/corrupt.
Connection control—Protocols can be either connectionless or connection-oriented.

Session Layer
It establishes, maintains, and synchronizes interaction among communicating systems.
Dialog control—It allows two systems to enter into a dialog and communication between
two processes to take place in either half-duplex / full-duplex mode.
Synchronization—The session layer allows a process to add checkpoints to a stream of
data. In case of a crash data is retransmitted from the last checkpoint.
Binding—binds together the different streams that are part of a single application. For
example, audio and video stream are combined in a teleconferencing application.
Presentation Layer
It is concerned with syntax and semantics of the information exchanged between peers.
Translation—Because different computers use different encoding systems, the
presentation layer is responsible for interoperability between these encoding methods.
Encryption—To carry sensitive information, a system ensures privacy by encrypting the
message before sending and decrypting at the receiver end.
Compression—Data compression reduces the number of bits contained in the
information. It is particularly important in multimedia transmission.

Vijai Anand cseannauniv.blogspot.com


CS6651-Computer Networks 1.5

Application Layer
The application layer enables the user, whether human or software, to access the network.
It provides user interface and support for services such as electronic mail, remote file
access, shared database management and several types of distributed services.

Explain the layers of TCP/IP architecture in detail.

Features
Internet architecture is a four layered model, also known as TCP/IP architecture. It
evolved out of a packet-switched network called ARPANET.
TCP/IP does not enforce strict layering, i.e., applications are free to bypass transport
layer and can directly use IP or any of the underlying networks.
IP layer serves as focal point in the architecture.
o It defines a common method for exchanging packets to any type of network
o Segregates host-to-host delivery from process-to-process delivery.
For any protocol to be added to the architecture, it must also be accompanied by at least
one working implementation of the specification. Thus efficiency is ensured.
Layers
Subnetwork TCP/IP does not define any specific protocol for the lowest level.
o All standard and proprietary protocols such as Ethernet, FDDI, etc are supported.
o The protocols are generally implemented by a combination of hardware/software.
IP The major protocol in TCP/IP is Internetworking Protocol (IP).
o It supports the interconnection of multiple networking technologies into a logical
internetwork.
o It is an unreliable and connectionless protocol.
o IP sends data in packets called datagrams, each of which is transported separately
and independently.
o Other protocols supported in this layer are ARP, RARP, ICMP and IGMP.
Transport layer is responsible for delivery of a message from one process to another
process. The two protocols supported in this layer are:
o Transmission Control Protocol (TCP) for connection-oriented reliable byte-
stream channel.
o User Datagram Protocol (UDP) for connectionless unreliable datagram delivery
channel.
Application supports a wide range of protocols such as FTP, TFTP, Telnet (remote
login), SMTP, etc., that enables the interoperation of popular applications.

Vijai Anand cseannauniv.blogspot.com


CS6651-Computer Networks 1.6

Explain how framing is done using bit and byte oriented protocols.
Framing enables the message to reach the destination by adding physical address of
sender and destination.
When a message is divided into smaller frames, error affects only that small frame.
In fixed-size framing, there is no need for defining frame boundary.
In variable-size framing, receiver should be able to determine where a frame starts/ends.
BYTE-ORIENTED PROTOCOLS
. The two different approaches are sentinel and the byte-counting.
Sentinel approach
Binary Synchronous Communication (BISYNC) protocol developed by IBM.

SYN special synchronization bits indicating beginning of the frame


SOH special sentinel character that indicates start of header
Header contains physical address of source, destination and other information
STX special sentinel character that indicates start of text/body
ETX special sentinel character that indicates end of text/body
CRC 16-bit CRC code used to detect transmission error
Character stuffing
The problem with sentinel approach, is that the ETX character might appear in the data.
In such case, ETX is preceded with a DLE (data-link-escape) character.
If the data portion contains escape character, then it is preceded by another DLE.
The insertion of DLE character onto the data is known as character stuffing.
The receiver removes the additional escape characters and correctly interprets the frame.
If ETX field is corrupted, then it is known as framing error. Such frames are discarded.

Byte-Counting Approach
An alternative to detect end-of-frame is to include number of bytes in the frame body as
part of the frame header.
Digital Data Communication Message Protocol (DDCMP) uses the count approach.

The Count field specifies how many bytes are contained in the frame’s body.
If Count field is corrupted, then it is known as framing error. The receiver comes to know
of it when it comes across the SYN field of the next frame.

Vijai Anand cseannauniv.blogspot.com


CS6651-Computer Networks 1.7

BIT-ORIENTED PROTOCOL
The bit-oriented protocols such as High-Level Data Link Control (HDLC) view the frame
as a collection of bits. The frame format

The beginning and end of a frame has a distinguished bit sequence 01111110
Sequence is also transmitted when link is idle for synchronization
Bit Stuffing
To prevent occurrence of bit pattern 01111110 as part of frame body, bit stuffing is used.
In bit stuffing, if a 0 and five consecutive 1 bits are encountered, an extra 0 is added.
This extra stuffed bit is eventually removed from the data by the receiver.
The real flag 01111110 is not stuffed by the sender and is recognized by the receiver
If a bit such as 01111111 arrives, then an error has occurred and the frame is discarded.

Clock-based Framing
Synchronous Optical Network (SONET) standard is clock-based framing of fixed size.
SONET runs on the carrier's optical network and offers rich set of services.
A SONET STS-1 frame is arranged as nine rows of 90 bytes each, shown below

The first 3 bytes of each row are overhead, with the rest being available for data
The first 2 bytes of the frame contain a special bit pattern indicating start of frame.
Bit stuffing is not employed here
The receiver looks for the special bit pattern once in every 810 bytes. If not so, the frame
is discarded.
The overhead bytes of a SONET frame are encoded using NRZ encoding. To allow the
receiver to recover sender’s clock, the payload bytes are scrambled.
SONET supports the multiplexing of multiple low-speed links. The links range from
51.84 Mbps (STS-1) to 2488.32 Mbps (STS-48).
At STS-1 rates, a frame is 810 bytes long, while at STS-3 rates, each frame is 2430 bytes
long. The multiplexing of three STS-1 frame onto one STS-3 is shown
STS-N signal can being used to multiplex N STS-1 frames. The payload from STS-1
frames are linked together to form a STS-N payload, denoted as STS-Nc.

Vijai Anand cseannauniv.blogspot.com


CS6651-Computer Networks 1.8

How errors are introduced in the data?


Bit errors are introduced into frames because of electrical interference or thermal noise.
This interference can change the shape of the signal, i.e. bit inversion.
List the types of error with an example.
The two types of error are single-bit error and burst error
Single-bit error means that only 1 bit of a given data unit is changed. Single-bit errors are
the least likely type of error in serial data transmission.

Burst error means that 2 or more bits in the data unit have changed
The length of the burst is measured from the first corrupted bit to the last corrupted bit.

Differentiate error detection and error correction.


Error detection means using redundant information (parity bits) along with data to enable
the receiver detect whether the received data is corrupted or not. Examples are Two
dimensional parity, Internet checksum, CRC, etc. When an error is detected, the data is
discarded and a retransmission is done by the sender.
In error correction, the redundant bits are used to determine which bits are corrupted and
original data is restored by the receiver. Examples are Hamming code, Reed Solomon,
etc. No retransmission is required.
What is Vertical Redundancy Check (VRC)?
It is based on simple parity, which adds one extra bit to a 7-bit code.
The 8th bit is set to make number of 1s in the byte as even, otherwise 0.
It is used to detect all odd-number errors in the block.
0110011 01100110
0110001 01100011

What is Longitudinal Redundancy Check (LRC)?


The data bits are divided into equal segments and organized as a table.
Parity bit is computed for each column.
The resulting parity byte is appended and transmitted.

Vijai Anand cseannauniv.blogspot.com


CS6651-Computer Networks 1.9

Explain error detection methods in detail with example


Error detection is only to see if any error has occurred
A single-bit error or a burst error is immaterial
The basic idea behind any error detection scheme is to add redundant information to a
frame that can be used to determine if errors have been introduced.
An efficient system should have k redundant bits for n data bits such that k << n
Two-Dimensional Parity
Data is divided into seven byte segments.
Even parity is computed for all bytes (Vertical Redundancy Check).
Even parity is also calculated for each bit position across each of the bytes (Longitudinal
Redundancy Check).
Thus a parity byte for the entire frame, in addition to a parity bit for each byte is sent.

The receiver recomputes the row and column parities. If parity bits are correct, the frame
is accepted else discarded.
Two-dimensional parity catches all 1, 2 and 3-bit errors, and most 4-bit errors.
Internet Checksum
The 16-bit checksum is not used at the link layer but by the upper layer protocols (UDP).
Sender
The data is divided into 16-bit words.
The initial checksum value is 0.
All words (incl. checksum) are summed using one's complement arithmetic.
Carries (if any) are wrapped and added to the sum.
The complement of sum is known as checksum and is sent with data
Receiver
The message (including checksum) is divided into 16-bit words.
All words are added using one's complement addition.
The sum is complemented and becomes the new checksum.
If the value of checksum is 0, the message is accepted, otherwise it is rejected.

Vijai Anand cseannauniv.blogspot.com


CS6651-Computer Networks 1.10

7 0111 0111
11 1011 1011
12 1100 1100
6 0110 0110
Initial Checksum 0000 Received Checksum 1001
Sum 100100 Sum 101101
Carry 10 Carry 10
Sum 0110 Sum 1111
Checksum 1001 New Checksum 0000
Sender Receiver
Analysis
Checksum is well-suited for software implementation and is not strong as CRC.
If value of one word is incremented and another word is decremented by the same
amount, the errors are not detected because sum and checksum remain the same.
Cyclic Redundancy Check (CRC)
CRC developed by IBM uses the concept of finite fields.
A n bit message is represented as a polynomial of degree n - 1.
The message M(x) is represented as a polynomial by using the value of each bit in the
message as coefficient for each term. For eg., 10011010 represents x7 + x4 + x3+ x
For calculating a CRC, sender and receiver agree on a divisor polynomial, C(x) of degree
k such that k n – 1
Sender
Multiply M(x) by xk i.e., append k zeroes. Let the modified poly be M'(x)
Divide M'(x) by C(x) using XOR operation. The remainder has k bits
Subtract the remainder from M'(x) using XOR, say T(x) and transmit T(x) with n + k bits.

Sender Receiver
Receiver
Divide the received polynomial T(x) by C(x) as done in sender
If the remainder is non-zero then discard the frame
If zero, then no errors and redundant bits are removed to obtain data

Vijai Anand cseannauniv.blogspot.com


CS6651-Computer Networks 1.11

Divisor Polynomial
The divisor polynomial C(x) should has the following error-detecting properties:
o All single-bit errors, as long as the xk and x0 terms have nonzero coefficients.
o Any “burst” error for which the length of the burst is less than k bits.
o Any odd number of errors, as long as C(x) contains the factor (x + 1)
The versions of C(x) widely used in link-level protocols are CRC-8, CRC-10, CRC-12,
CRC-16, CRC-CCITT and CRC-32.
CRC algorithm is implemented in hardware using a k-bit shift register and XOR gates.
CRC is widely used in networks such as LANs and WANs.

Define flow control.


Flow control is a set of procedures that tells the sender how much data it can transmit
before it must wait for an acknowledgment from the receiver.
It prevents a fast sender from overwhelming a slow receiver with frames.
Define acknowledgement.
An acknowledgment (ACK) is a small control frame that a protocol sends back to the
sender acknowledging the receipt of a frame.
Frames are delivered in a reliable manner using acknowledgement
What is automatic repeat request?
When a corrupt frame arrives at the receiver, it is discarded.
If the sender does not receive an acknowledgment within a specified period (timeout), it
retransmits the original frame. This is known as automatic repeat request (ARQ).
The two ARQ are Stop and Wait ARQ and Sliding Window ARQ
Explain various flow control mechanism or reliable transmission.
Stop and Wait ARQ
The sender keeps a copy of the frame and then transmits it.
The sender waits for an acknowledgment before transmitting the next frame.
If acknowledgment does not arrive before timeout, the sender retransmits the frame.

Vijai Anand cseannauniv.blogspot.com


CS6651-Computer Networks 1.12

Scenarios
a) ACK is received before the timer expires. The sender sends the next frame.
b) The frame gets lost in transmission. Sender eventually times out and retransmits frame.
c) ACK frame gets lost. The sender eventually times out and retransmits the frame.
d) The sender times out soon before ACK arrives and retransmits the frame.
Sequence number
In scenarios (c) and (d), since the receiver has acknowledged the received frame, it treats
the arriving frame as the next one. This leads to duplicate frames.
To address duplicate frames, the header for a stop-and-wait protocol includes a 1-bit
sequence number (0 or 1) based on modulo-2 arithmetic.

Drawbacks
It allows the sender to have only one outstanding frame on the link at a time
Inefficient if the channel has a large bandwidth and the round-trip delay is long.
Sliding window
To improve efficiency, multiple frames must be in transition while waiting for an
acknowledgment. Sliding window protocol makes this possible.

The window defines range of sequence numbers for both sender and receiver to deal with.
The window position change (slides) due to transmission of frame and acknowledgement
Sender
The sender assigns a sequence number SeqNum to each frame.
A timer with each frame it transmits, and retransmits the frame on timeout.
It maintains three state variables:
o The send window size SWS gives the upper bound on the number of outstanding
frames that the sender can transmit.
o LAR denotes the sequence number of the last acknowledgment received.
o LFS denotes the sequence number of the last frame sent.
o The invariant LFS LAR SWS is always maintained

Vijai Anand cseannauniv.blogspot.com


CS6651-Computer Networks 1.13

When an acknowledgment arrives, the sender moves LAR to the right, thereby allowing
the sender to transmit the subsequent frames.
The sender buffers up to SWS frames (for retransmission), until they are acknowledged.
Receiver
Similarly the receiver maintains three state variables:
o The receive window size RWS gives the upper bound on number of out-of-order
frames that the receiver is willing to accept.
o LAF denotes acceptable frame with the largest sequence number
o LFR denotes sequence number of the last frame received
o The invariant LAF LFR RWS is always maintained.

A frame numbered SeqNum is accepted if LFR < SeqNum LAF, otherwise discarded.
Frames can arrive out of order and may be buffered.
If all frames, say with sequence number SeqNumToAck have arrived, the receiver
acknowledges frame SeqNumToAck. The variables updated are:
o LFR = SeqNumToAck
o LAF = LFR + RWS
Window size
SWS depend on how many frames are expected to be outstanding on the link. It is based
on delay × bandwidth product.
RWS is either set to 1 or the value of SWS.
o If RWS = 1, then receiver does not buffer frames.
o If RWS = SWS, receiver buffers out-of-order frames, but does not acknowledge.
Example

Vijai Anand cseannauniv.blogspot.com


CS6651-Computer Networks 1.14

Lost/Corrupt frames
When frames are lost or corrupt, there is less data in transit, since the sender cannot
advance its window without an acknowledgement.
The receiver acknowledges a frame, only if all lower numbered frames have arrived. The
acknowledgement is cumulative.
The receiver buffers out of order frames but does not acknowledge.
It sends a negative acknowledgement (NAK) indicating to the sender to retransmit the
expected frame.
NAK speeds up retransmission of a frame before timer expires and improves performance.

Sequence Number
Sequence numbers are modulo 2m where m is the size of the sequence field in bits.
Sequence numbers wrap around and MaxSeqNum denotes number of available sequence
numbers.
To avoid the issue of identifying sequence numbers of different sets, SWS is defined as
SWS < (MaxSeqNum + 1) / 2
Advantages
It delivers frames reliably across an unreliable link using timeout and acknowledgement.
It preserves the order in which frames are transmitted. The receiver ensures that it does
not pass a frame to the upper layer until all lower numbered frames are passed.
It supports flow control. The receiver through acknowledgement informs the sender about
how many frames it can still receive.
Distinguish between Stop & Wait and Sliding window protocol.
Only one frame could be outstanding in Stop-and-Wait, whereas multiple frames can be
outstanding in sliding window, i.e., improved efficiency.
The Stop-and-Wait ARQ protocol is a special case of sliding window in which the send
window size is 1.
Frames are numbered as modulo-2m in sliding window whereas it is sequenced as
modulo-2 in stop and wait protocol.
What is concurrent logical channel?
When more than one logical channel is multiplexed onto a single point-to-point link is
known as concurrent logical channel.
Stop and wait is run on each of these logical channels.
The sender maintains 3-bit state information namely whether busy, sequence number of
next frame and sequence number of next frame expected.
When a node has frame to send, it is sent on the lowest idle channel.

Vijai Anand cseannauniv.blogspot.com


CS6651-Computer Networks 1.15

Explain the factors that affect performance of the network.


Bandwidth and Latency
Performance of a network is measured in terms of bandwidth and latency.
Bandwidth refers to number of bits that can be transmitted over the network within a
certain period of time (throughput).
Bandwidth also determines how long it takes to transmit each bit. For example, each bit
on a 1-Mbps link is 1µs wide, while each bit on a 2-Mbps link is 0.5µs wide

Bandwidth is also based on how many times the software that implements the channel has
to handle.
Latency refers to how long it takes for the message to travel to the other end (delay). It is
a factor of propagation delay, transmission time and queuing delay
Latency = Propagation + Transmit + Queue
Propagation = Distance / SpeedOfLight
Transmit = Size / Bandwidth
o Speed of light propagation varies on medium (2.3 × 108 m/s in copper, 2.0 × 108
m/s in optical fiber) and distance.
o Transmission time depends upon bandwidth and packet size
o Queuing delay occurs at switches and routers.
Round Trip Time (RTT) is a two-way latency.
For applications that have minimal data transfer, latency dominates performance and for
bulk data transfers, bandwidth dominates performance.
Delay × Bandwidth Product

Consider a pipe, in which bandwidth is given by diameter and delay corresponds to


length of the pipe.
The delay × bandwidth product specifies the number of bits in transit. It corresponds to
how much the sender should transmit before the first bit is received at the other end.
If receiver signals the sender to stop, it would still receive RTT × bandwidth of data.
For example, for a cross-country fiber with 10 Gbps bandwidth, distance of 4000 km, the
RTT is 40 ms and RTT × bandwidth is 400 Mb.
High Speed Networks
High speed networks enhances the bandwidth for applications but latency remains fixed.
For example, when a 1 MB file is transmitted over a 1 Mbps link takes 80 RTTs, whereas
the same file over a 1 Gbps links falls short of 1 RTT.
Effective end-to-end throughput that can be achieved is given as
Throughput = TransferSize / TransferTime
TransferTime includes latency as well as setup time. It is computed as
TransferTime = RTT + 1/Bandwidth × TransferSize

Vijai Anand cseannauniv.blogspot.com


CS6651-Computer Networks 1.16

Application Performance Needs


Applications generally require as much bandwidth provided by the network.
Some applications such as video, specify an upper limit on bandwidth required.
Video streams are generally compressed but the flow rate varies due to details,
compression algorithm used, etc. The average bandwidth could be determined, but
instantaneous bursty traffic should be accounted for.
In some cases, the latency varies from packet to packet, known as jitter. Suppose that the
packets being transmitted over the network contain video frames, the receiver will not be
able to display, if a frame arrives late. If the receiver knows the latency that packets may
experience, then it can delay playing first frame of the video. Thus jitter factor is
smoothened out by buffering.

Give the format of a PPP frame and explain its fields.

The Point-to-Point Protocol (PPP) is used to carry packets over point-to-point links.
The flag field contains special character 01111110
The protocol field is used for multiplexing.
The payload is 1500 bytes by default.
Explain the socket API for implementing network application.
Network protocols are implemented as part of operating system and interface provided is
known as network application programming interface (API).
Network APIs provide syntax through which protocol services are invoked.
The socket interface from Berkley Unix is widely used.
Abstraction of the socket interface is called socket. Socket is an endpoint on the
communication link between applications running on the network.
Operations defined are socket creation, binding socket to network, send / receive
messages and finally close the socket.
Socket Creation
Socket is created using socket interface. A handle is returned on successful creation.
int socket(int domain, int type, int protocol)

Vijai Anand cseannauniv.blogspot.com


CS6651-Computer Networks 1.17

o domain argument specifies protocol family (PF_INET for Internet family,


PF_PACKET for direct access to network, etc)
o type argument specifies stream (SOCK_STREAM for byte stream, SOCK_DGRAM
for message-oriented service, SOCK_RAW for raw sockets)
o protocol argument specifies the protocol used (default value 0).
Server Process
Server processes perform passive open, i.e., it waits for client requests by invoking the
following operations:
int bind(int socket, struct sockaddr *address, int addr_len)
int listen(int socket, int backlog)
int accept(int socket, struct sockaddr *address, int *addr_len)
o bind operation attaches the socket to server host's IP address and port. Server port
number is well-known, i.e., 0–1024 (for example, web servers use port 80).
o listen operation specifies number of pending connections.
o accept operation blocks until a client establishes connection
Client Process
Client processes perform active open, i.e., it establishes connection with the server using
connect operation.
int connect(int socket, struct sockaddr *address, int addr_len)
Client knows the remote server's logical address and port number and lets the system fill
in detail such as client IP address and ephemeral port number.
Communication
Communication between server and client process takes place after connection
establishment using send and recv operation.
int send(int socket, char *message, int msg len, int ags)
int recv(int socket, char *buffer, int buf len, int ags)
o send operation is used to send message over the socket and recv operation is used
to store the message received over the socket onto a buffer.
Chat Application
Chat application is a simple client/server program that uses the socket interface to send
messages over a TCP connection in half-duplex mode.

/* TCP Chat server program */

#include <stdio.h>
#include <string.h>
#include <netinet/in.h>

main()
{
int sd, bd, ad;

Vijai Anand cseannauniv.blogspot.com


CS6651-Computer Networks 1.18

struct sockaddr_in servaddr, cliaddr;


socklen_t clilen;
char buff[1024], buff1[1024];

/* Socket address structure */


bzero(&servaddr, sizeof(servaddr));
servaddr.sin_family = AF_INET;
servaddr.sin_addr.s_addr = htonl(INADDR_ANY);
servaddr.sin_port = htons(5555);

/* TCP socket creation */


sd = socket(PF_INET, SOCK_STREAM, 0);

/* Passive Open */
bd = bind(sd, (struct sockaddr*)&servaddr, sizeof(servaddr));
listen(sd, 5);
printf("Server is running\n");
ad = accept(sd, (struct sockaddr*)&cliaddr, &clilen);
printf("Client connection established\n");

while(1)
{
/* Receive message from client */
recv(ad, buff, sizeof(buff), 0);
printf("Received from the client: %s", buff);
if (strcmp(buff, "bye") == 0)
break;

/* Send message to the client */


printf("\nEnter the input data: ");
fgets(buff1, 1024, stdin);
send(ad, buff1, strlen(buff1)+1, 0);
}
printf("\nClient disconnected\n");
}

Header file <netinet/in.h> defines IPv4 socket address structure called sockaddr_in
Socket data structure is constructed using a port number that is not used for any internet
service, say 5555.
Server's IP address is set as INADDR_ANY to accept connections on any of the host’s IP
addresses.
After passive open, server exchanges messages with the client.

/* TCP Chat client program */

#include <stdio.h>

Vijai Anand cseannauniv.blogspot.com


CS6651-Computer Networks 1.19

#include <string.h>
#include <netinet/in.h>

main(int argc, char *argv[])


{
int sd, cd;
struct sockaddr_in servaddr;
char buff[1024], buff1[1024];

/*Socket address structure*/


bzero(&servaddr, sizeof(servaddr));
servaddr.sin_family = AF_INET;
if (argc == 2)
servaddr.sin_addr.s_addr = inet_addr(argv[1]);
else
servaddr.sin_addr.s_addr = inet_addr("127.0.0.1");
servaddr.sin_port = htons(5555);

/* TCP Socket creation */


sd = socket(PF_INET, SOCK_STREAM, 0);

/* Active Open */
cd = connect(sd, (struct sockaddr*)&servaddr, sizeof(servaddr));

printf("Enter \"bye\" to quit\n");


while(1)
{
/* Send message to the server */
printf("Enter the input data: ");
gets(buff);
send(sd, buff, strlen(buff)+1, 0);
if (strcmp(buff, "bye") == 0)
break;

/* Receive message from the server */


recv(sd, buff1, sizeof(buff1), 0);
printf("Received from the server: %s", buff1);
}
printf("Connection Terminated\n");
}

Client builds data structure required for the socket interface and opens an active
connection with the server.
If server's IP address is not given as command line argument, then server process is
running on the same localhost.
The client uses sentinel value (bye) to terminate the connection.

Vijai Anand cseannauniv.blogspot.com


CS6651-Computer Networks 1.20

Discuss the requirements for building a computer network.


Perspectives
An application programmer list the services based on application needs. For example, a
guarantee that each message will be delivered without error or within a certain time or to
allow graceful switching in a mobile environment.
A network operator lists the characteristics of a system that is easy to administer and
manage. For example, fault isolation, adding new devices, easy to account for usage, etc.
A network designer lists the properties of a cost-effective design. For example, efficient
utilization of network resources, fair allocation to users, etc.
Scalable Connectivity
A system that is designed to support growth to an arbitrarily large size is scalable.
Physical medium is referred to as link, and devices that connect to the link are nodes.
Link could be either dedicated point-to-point between nodes or shared amongst nodes
with multiple access.
End nodes can be connected through a set of forwarding nodes called switches.
Switching could be either circuit or packet switching.
Packet switching networks uses store-and-forward method, i.e. the switch receives a
packet, stores in its buffer and later forwards onto another link.
Independent networks are connected to form internetwork or internet. A node that
connects two or more networks is known as router.
The process of forwarding frames from source to destination is known as routing.
A node can also send messages to a group of nodes (multicasting) or to all nodes on the
network (broadcasting).
Each node on the network is assigned a unique address.

Cost-Effective Resource Sharing


Hosts can share network resources using the concept of multiplexing. For example,
multiple flows can be multiplexed onto a single physical link.
Synchronous time-division multiplexing (STDM) divides time into equal slots and flows
use the slots in a round-robin manner.
Frequency-division multiplexing (FDM) transmits each flow at different frequency.
In statistical multiplexing, link is shared over time as in STDM, but packets are
transmitted from each flow on demand, rather than on predetermined slot.
Packets multiplexed at one end, is demultiplexed at the other switch.

Vijai Anand cseannauniv.blogspot.com


CS6651-Computer Networks 1.21

Switch decides which packet is to be transmitted from the packets queued up, according
to queuing discipline such as FIFO.

Support for Common Services


Since applications have common services in, it is apt for the network designer to identify
and implement a common set of services for the application designer to build upon.
Network provide logical channels and set of services required for process-to-process
communication.
Functionalities may include guaranteed delivery, in-order delivery, privacy, etc.
File access program such as FTP / NFS or sophisticated digital library application require
read and write operation performed either by client / server.
Two types of communication channels that could be provided are request/reply and
message stream channel
Request/reply channel guarantees delivery of message and ensures privacy and integrity
of data required in case of FTP or digital library.
Message stream channel does not guarantee delivery of all data but assures in-order
delivery, required in applications like video conferencing.
Reliability
Reliability is an important characteristic to be provided by the network, i.e., it should be
possible for the network to recover from errors.
Single bit/ burst errors may occur during data transmission due to interference. Such
errors can be detected and retransmission sought for.
Packets can be dropped due to congestion or wrongly routed.
Links can fail or node can crash. In case of failed link, it should be possible to route the
packet along alternate path.
Manageability
Network needs troubleshooting to adapt to increase in traffic or to improve performance.
Managing network devices on the internet to work correctly is a challenging one.
Automating network management tasks is needed for scalability and cost-effectiveness.
Network nowadays is common and could be managed by consumers with little skill level.

Vijai Anand cseannauniv.blogspot.com

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy