You are on page 1of 98

Unit 1

1. Define computer network


A computer network is a group of computers linked to each other that enables the computer to communicate with another computer and share their
resources, data, and applications
The connection usually will be on a communication medium like copper wire,
fiber optics. Eg; internet

2. What are the different uses of computer network?


 file sharing, which enables users to share data files through a network;
 application sharing, which enables users to share applications through a network;
 hardware sharing, which enables users in a network to share hardware devices, such as printers and hard drives;
 communication, which can include video, text and voice;
 e-commerce, which enables users to sell and buy products over the internet;

3.Expand VPN, RFID

RFID (radio frequency identification)


VPN (virtual private network)

4.Expand GPS, NFC.

NFC (Near Field Communication)


GPS (Global Positioning System)

5. Expand DMCA, CAPTCHA.

. DMCA (Digital Millennium Copyright Act),

. CAPTCHA (Completely Automated Public Turing test to tell Computers and Humans Apart)

6. WiMAX (Worldwide Interoperability for Microwave Access)

NSP (network service provider)

7. Expand ARPANET, ICMP.

Advanced Research Projects Agency Network (ARPANET),

Internet Control Message Protocol (ICMP)

8. The Simple Mail Transfer Protocol (SMTP)

Real-Time Transport Protocol (RTP)

9. Hypertext Transfer Protocol (HTTP)

Teletype Network Protocol (Telnet)

10. DNS (Domain Name Server)

FTP (File Transfer Protocol

11. Transmission control protocol (TCP)

user datagram protocol (UDP)

12.DSL (Digital Subscriber Line)

SONET (Synchronous Optical Network)


13. Expand LAN, MAN, WAN

o LAN(Local Area Network)

o PAN(Personal Area Network)

o MAN(Metropolitan Area Network)

o WAN(Wide Area Network)

14.what is peer to peer model?

When devices are linked together, they share resources without requiring separate server or server software. The peer to peer computing architecture contains nodes
that are equal participants in data sharing. All the tasks are equally divided between all the nodes. The nodes interact with each other as required as share resources.

15. What is client-server model?

The Client-server model is a distributed application structure that partitions task or workload between the providers of a resource or service, called servers, and
service requesters called clients. In the client-server architecture, when the client computer sends a request for data to the server through the internet, the server
accepts the requested process and deliver the data packets requested back to the client

Clients do not share any of their resources. Examples of Client-Server Model are Email, World Wide Web, etc.

16. .List the different forms of e-commerce

Tag Full name Example

B2C Business-to-consumer Ordering books online

B2B Business-to-business Car manufacturer ordering tires from supplier

G2C Government-to-consumer Government distributing tax forms electronically

C2C Consumer-to-consumer Auctioning second-hand products online

P2P Peer-to-peer Music sharing

17. What is profiling and phishing?

Phishing :A technique for attempting to acquire sensitive data, such as bank account numbers, through a fraudulent solicitation in email or on a web site, in which
the perpetrator masquerades as a legitimate business or reputable person.

Profiling: Profiling is the practice of attempting to understand a person or group based on general characteristics or on past behaviors. analysis of a person's
psychological and behavioural characteristics

18: What are the two types of transmission technology?


Broadcast Networks : Broadcasting is simply a method of transferring messages to all the recipients simultaneously.

Point-to-Point Networks : Point-to-Point Networks or Point-to-Point Connection is type of private data connection that is connecting securely two or more
locations for private data services

19. What is unicasting and broadcasting?

Unicast: This type of information transfer is useful when there is a participation of a single sender and a single recipient. So, in short, you can term it as a one-to-one
transmission

Broadcast: Broadcast: from one source to all possible destinations i.e. One-to-All.

20. What are static and dynamic allocation methods.


With a static approach, the channel's capacity is essentially divided into fixed portions; each user is then allocated a porti on for all time. If the user has no traffic to
use in its portion, then it goes unused. With a dynamic approach the allocation of the channel changes based on the traffic generated by the users.

21. .What is communication subnet?


network that connects these hosts is then called the communication subnet. Subnetting is a method of dividing a single physical
network into numerous smaller logical sub-networks.
The job of the subnet is to carry messages from host to host, just as the telephone system carries words (really just sounds) from speaker to listener.

22. List and explain the components of subnet

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.
Switching elements, or just switches, are specialized computers that connect two or more transmission lines
23. What are routing and forwarding algorithm?
A Router is a process of selecting path along which the data can be transferred from source to the destination

When a packet arrival each router makes the decision as to where to send a packet next is called the forwarding algorithm

24. What is addressing and flow control?

Addressing : each layer needs a mechanism for identifying the sender and receiver.

Flow control: refers to set of procedures used to restrict the amount of data that the sender can send beforewaiting for acknowledgment

25. Differentiate connection oriented and connectionless service


Connection-oriented Service is necessary. Connection-less Service is not compulsory.

Connection-oriented Service is feasible.Connection-less Service is not feasible.

Connection-oriented Service gives the guarantee of reliability. Connection-less Service does not give a guarantee of reliability.

In connection-oriented Service, Packets follow the same route. In connection-less Service, Packets do not follow the

same route

26. What is store-and-forward switching and cut-through switching?

Store-and-forward Switching is a technique that waits Cut-through Switching is a technique that checks the first 6 bytes following the
until the entire frame is received. preamble to identify the destination address.

It performs error checking functionality.

When the intermediate nodes receive a message in full before sending it on to the next node, this is called store-and-forward switching. The alternative, in which the
onward transmission of a message at a node starts before it is completely received by the node, is called cut-through switching.

27. List the different service primitives.

 Listen
 Connect
 Receive
 Send
 Disconnect
 Accept
28.What is service and protocol?

Protocol is defined as set of rules and regulations for data communication it determine hoe data is transmitted bw different devices in the same network.

Service: A service is a set of primitives (operations) that a layer provides to the layer above it. The service defines what operations the layer is prepared to perform on
behalf of its users,

29. Differentiate OSI and TCP/IP reference model.

Osi:

7 layer

Follows vertical approach

Provides quality services

Tcp/ip:

4 layer

Follows horizontal approach

Doesn’t provide quality services

````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````7. Explain
protocol hierarchies.
⮚ Networks are collection of layers

⮚ Each layer is to offer certain services

⮚ The number of layers, the name of each layer, the contents of each layer, and

the function of each layer differ from network to network

⮚ The purpose of each layer is to offer certain services to the higher layers

⮚ A set of layers and protocols is called a network architecture .

⮚ Ex: A five-layer network

Advantages :

 The layers generally reduce complexity of communication between networks

 It increases network lifetime.

 It also uses energy efficiently.

 It does not require overall knowledge and understanding of network.


8. Explain design issues for the layers.

• Some of the key design issues are:

1) error detection

• There is a chance that some of these bits will be received damaged

(inverted) due to fluke electrical noise, random wireless signals, hardware

flaws, software bugs and so on.

• One mechanism for finding errors in received information uses codes for

error detection.

2) routing
• Another reliability issue is finding a working path through a network is

called routing

3) addressing

• Since there are many computers on the network, every layer needs a

mechanism for identifying the senders and receivers that are involved in a

particular message. This mechanism is called addressing or naming

..connection and connectionless services

9.Differentiate connection oriented and connectionless service

S.NO Connection-oriented Service Connection-less Service

1. Connection-oriented service is related to the telephone system. Connection-less service is related to the postal system

3. Connection-oriented Service is necessary. Connection-less Service is not compulsory.

4. Connection-oriented Service is feasible. Connection-less Service is not feasible.

5. In connection-oriented Service, Congestion is not possible. In connection-less Service, Congestion is possible.

6. Connection-oriented Service gives the guarantee of reliability. Connection-less Service does not give a guarantee of reliability.

7. In connection-oriented Service, Packets follow the same route. In connection-less Service, Packets do not follow the same route.

9. Ex: TCP (Transmission Control Protocol) Ex: UDP (User Datagram Protocol)

10. Connection-oriented requires authentication. Connection-less Service does not require authentication.

Unit 2

1. Expand UTP, IrDA


UTP (Unshielded Twisted Pair)
IrDA (Infrared Data Association)

2. Expand STDM, CDMA


CDMA (Code Division Multiple Access)
STDM (Statistical Time Division Multiplexing).
3. Expand FDM, OFDM.
FDM (Frequency Division Multiplexing)
OFDM (Orthogonal Frequency Division Multiplexing)

4.Expand TDM, CDM.

TDM (Time Division Multiplexing)

. CDM (Code Division Multiplexing)

5. What are single-mode and multimode fiber.

1. Single-Mode Optical Fiber Cable :


SMF (Single-Mode Fibers) is the fiber cable that is designed to carry only a single mode of light that is the transverse mode. These are used for the long-
distance transmission of signals.

2. Multimode: Designed to carry multiple modes of light at once and Used for comparatively shorter distance transmission of signals.

6.What is chromatic dispersion and solitons.

light pulses sent down a fiber spread out in length as they propagate. This spreading is called chromatic dispersion

pulses with a certain balance of nonlinear and dispersive effects. so it is possible to send pulses for thousands of kilometers without appreciable shape
distortion. These pulses are called solitons.

7.Differentiate fiber optics and copper wire.

Sr.
No. Basis Fiber Optic Cable Copper Wire

Data It carries data in the form of electric


1. Carrier It carries data in the form of light. signals.

2. Bandwidth It offers higher bandwidth. It offers lower bandwidth.

It is thin, lighter in weight, and smaller in


3. Structure size. It is heavier and thicker

5. Attenuation Attenuation is very low. Attenuation is high.

8.What is path loss?

Path loss (PL) refers to the loss or attenuation a propagating electromagnetic signal (or wave) encounters along its path from transmitter to the receiver..
At high frequencies, radio waves tend to travel in straight lines

9. .What is multipath fading?

The delayed waves may arrive out of phase with the direct wave and thus cancel the signal. This effect is called multipath fadingThe echoes can cancel or
reinforce each other, causing the received signal to fluctuate greatly. This phenomenon is called multipath fading,

10. What is digital modulation


To send digital information, we must devise analog signals to represent bits. The process of converting between bits and signals that represent them is
called digital modulation.

11. .What are the applications of FDM.

It allows sharing of a single transmission medium like a copper cable or a fiber optic cable, among multiple independent signals generated by multiple
users.

FDM has been popularly used to multiplex calls in telephone networks. It can also be used in cellular networks, wireless networks and for satellite
communications.

12. .Differentiate FDM and TDM

TDM FDM TDM

TDM stands for Time Division FDM stands for Frequency


Definition Multiplexing. Division Multiplexing.

Signal TDM works well with both analog as FDM works only with analog
well as digital signals. signal.

Conflict TDM has low conflict. FDM has high conflict.

Efficiency TDM is efficient FDM is quiet inefficient.

Sharing Time is shared in TDM. Frequency is shared in FDM.

13..List the different switching techniques.

 Circuit Switching.

 Packet Switching.

 Message Switching.

14. Differentiate circuit switching and packet switching.

Circuit Switching Packet Switching

Circuit switching is more reliable. Packet switching is less reliable.

Wastage of resources is more in Circuit Switching Less wastage of resources as compared to Circuit Switching

It is not a store and forward technique. It is a store and forward technique.

Recording of packets is never possible in circuit switching. Recording of packets is possible in packet switching.
In-circuit switching each packet follows the same route. In packet switching packets can follow any route.

The circuit switching network is implemented at the physical layer. Packet switching is implemented at the datalink layer and network layer

Circuit switching requires simple protocols for delivery. Packet switching requires complex protocols for delivery.

The delay between data units in circuit switching is uniform. The delay between data units in packet switching is not uniform.

15. Write the various services offered by the data link layer to the network layer
The data link layer can be designed to offer various services. The actual ser- vices that are offered vary
from protocol to protocol. Three reasonable possibilities that we will consider in turn are:
1. Unacknowledged connectionless service.
2. Acknowledged connectionless service.
3. Acknowledged connection-oriented service.
Unacknowledged connectionless service:
• It consists of having the source machine send independent frames to the destination machine without
having the destination machine acknowledge them.
• If a frame is lost due to noise on the line, no attempt is made to detect the loss
• Ex: Ethernet
Acknowledged connectionless service.
• When this service is offered, there are still no logical connections used, but each frame sent is
individually acknowledged.
• In this way, the sender knows whether a frame has arrived correctly or been lost.
• Ex: Wi-Fi
Acknowledged connection-oriented service.
• The network layer can always send a packet and wait for it to be acknowledged by its peer on the remote
machine.
• If the acknowledgement is not forthcoming before the timer expires, the sender can just send the entire
message again.
• The trouble with this strategy is that it can be inefficient.
16.
PPP (Point-to-Point Protocol)

HDLC (Highlevel Data Link Control)

17.

FEC (Forward Error Correction)

NIC (Network Interface Cards)

18. What are the two different approaches of Flow control.

Flow control is meant only for the transmission of data from sender to receiver.

For Flow control there are two approaches : Feedback-based Flow Control and Rate-based Flow Control.

This situation can occur when the sender is running on a fast, powerful computer and the

receiver is running on a slow, low-end machine. It prevents the loss of data and avoid over running of receive buffers.

This will generate waste frames on the network. Therefore, the receiving device must have some mechanism to inform the sender to send fewer frames or stop
transmission temporarily. In this way, flow control will control the rate of frame transmission to a value that can be handled by the receiver.

Example of Flow Control techniques are : Stop&Wait Protocol and Sliding Window Protocol.

Two approaches are commonly used.:

• feedback-based flow control,

• rate-based flow control

In the first one, feedback-based flow control, the receiver sends back information to the sender

giving it permission to send more data, or at least telling the sender how the receiver is doing.

In the second one, rate-based flow control, the protocol has a built-in mechanism that limits the rate at

which senders may transmit data, without using feedback from the receiver.

19. .What is erasure channel?

the physical layer received an analog signal that was far from the expected value for a 0 or 1 and declared the bit to be lost. This situation is called an erasure
channel.

20. .List the different error-correcting codes

• Hamming codes.

• Binary convolution codes.

• Reed-Solomon codes.

• Low-Density Parity Check codes.

21. List the different error-detecting codes.

1. Parity. 2. Checksums. 3. Cyclic Redundancy Checks (CRCs).

22.
LDPC (Low-Density Parity Check)

CRC (Cyclic Redundancy Check

23. .List the different fields from which the frame is composed of.
. kind, seq, ack, and info
24. What is meant by event=cksum_err and event=frame_arrival ?
When a frame arrives at the receiver, the checksum is recomputed. If the checksum in the frame is incorrect (i.e., there was a transmission error), the data
link layer is so informed (event = cksum err). If the inbound frame arrived undamaged, the data link layer is also informed (event = frame arrival) so that it
can acquire the frame for inspection using from physical layer.
``````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````
1.Write a note on the following
: i. Error control
The error control function of data link layer detects the errors in transmitted frames and re-transmit all the erroneous frames. Error control is meant for the
transmission of error free data from sender to receiver.
To detect error in data, the approaches are : Checksum, Cyclic Redundancy Check and Parity Checking.
To correct error in data, the approaches are : Hamming code, Binary Convolution codes, Reed-Solomon code, Low-Density Parity Check codes.

Example – Stop & Wait ARQ and Sliding Window ARQ

• The usual way to ensure reliable delivery is to provide the sender with some feedback about what is
happening at the other end of the line.
• Typically, the protocol calls for the receiver to send back special control frames bearing positive or
negative acknowledgements about the incoming frames.
• If the sender receives a positive acknowledgement about a frame, it knows the frame has arrived safely.
• On the other hand, a negative acknowledgement means that something has gone wrong and the frame
must be transmitted again.

2. Explain Hamming code of error-correcting codes


• It is a set of error-correction codes that can be used to detect and correct the errors that can
occur when the data is moved or stored from the sender to the receiver.
• It is a technique developed by R.W. Hamming for error correction.
• Redundant bits are extra binary bits that are generated and added to the information-carrying
bits of data transfer to ensure that no bits were lost during the data transfer.
 The number of bit positions in which two codewords differ is called the Hamming distance  Hamming distances are valuable for understanding block
codes, and Hamming codes are used in error-correcting memory

Parity bits: Parity bits are used for error detection two tpyes:

Even parity: To check for even parity, if the total number of 1s is even, then the value of the parity bit is 0. If the total number of 1s occurrences is odd,
then the value of the parity bit is 1.

Odd Parity: To check for odd parity, if the total number of 1s is even, then the value of parity bit is 1. If the total number of 1s is odd, then the value of
parity bit is 0.

The number of redundant bits can be calculated using the following formula:

2^r ≥ m + r + 1

where, r = redundant bit, m = data bit

Suppose the original data is 1010 which is to be sent.

Total number of data bits 'd' = 4

Number of redundant bits r : 2^r >= m+r+1

2^r>= 4+r+1

8>=8

Therefore, the value of r is 3 that satisfies the above relation. Thus, the number of redundant bits= 3Parity bits

3. .Explain Binary convolutional code of error-correcting codes


This code is the only one we will cover that is not a block code. In a convolution code, an
encoder processes a sequence of input bits and generates a sequence of output bits. There is no natural
message size or encoding boundary as in a block code. The output depends on the current and previous
input bits. That is, the encoder has memory. The number of previous bits on which the output depends
is called the constraint length of the code. Convolution codes are specified in terms of their rate and
constraint length.
Convolution codes are widely used in deployed networks, for example, as part of the GSM mobile phone
system, in satellite communications, and in 802.11. As an example, a popular convolution code is shown
in Fig. 3-7. This code is known as the NASA convolution code of r 1/2 and k 7

A convolution code is decoded by finding the sequence of input bits that is most likely to have produced the

observed sequence of output bits (which includes any errors). Convolution codes have been popular in practice

because it is easy to factor the uncertainty of a bit being a 0 or a 1 into the decoding. Two types of decoding are :

soft-decision decoding and hard-decision decoding.

each input bit on the left-hand side produces two output bits on the right-hand side that are XOR sums of the input and internal state. Since it deals with
bits and performs linear operations, this is a binary, linear convolutional code. Since 1 input bit produces 2 output bits, the code rate is 1/2. It is not
systematic since none of the output bits is simply the input bit

4. Reed-solomon codes
Like Hamming codes, Reed-Solomon codes are linear block codes, and they are often
systematic too. Unlike Hamming codes, which operate on individual bits, Reed-Solomon codes operate
on m bit symbols. Naturally, the mathematics are more involved, so we will describe their operation by
analogy
Reed-Solomon codes are based on the fact that every n degree polynomial is uniquely determined by n
1 points. For example, a line having the form ax bis determined by two points. Extra points on the
same line are redundant, which is helpful for error correction. Imagine that we have two data points that
represent a line and we send those two data points plus two check points chosen to lie on the same line.
If one of the points is received in error, we can still recover the data points by fitting a line to the
received points. Three of the points will lie on the line, and one point, the one in error, will not. By
finding the line we have corrected the error

Application of Reed-Solomon codes


 It is used in storage devices like CDs, DVDs, etc.
 It is used in wireless or mobile communication for data transfer.
 It is used in satellite communication.
 Reed-Solomon codes are also used in digital TV.
 It is used in high-speed modems.
 It is used in the BAR code, QR code.
Advantages:
Here we will discuss how it is better than binary BCH codes.

It has the highest efficient use of redundancy.


It is possible to adjust block length and symbol size in Reed-Solomon codes.
It provides a wide range of code rates.
In Reed-Solomon codes, there are efficient decoding techniques available.

5. Low-Density Parity Check codes(LDPC)


LDPC codes are linear block codes that were invented by Robert Gallagher. In an LDPC code,
each output bit is formed from only a fraction of the input bits. This leads to a matrix representation of
the code that has a low density of 1s, hence the name for the code. The received codewords are decoded
with an approximation algorithm that iteratively improves on a best fit of the received data to a legal
codeword. This corrects errors.
LDPC codes are practical for large block sizes and have excellent error-correction abilities that
outperform many other codes (including the ones we have looked at) in practice. For this reason they
are rapidly being included in new protocols. They are part of the standard for digital video broadcasting,
10 Gbps Ethernet, power-line networks, and the latest version of 802.11.

6. Explain Parity of error-detecting code with example.


Simple Parity check Blocks of data from the source are subjected to a check bit or parity bit generator form, where a parity of : 1 is added to the block if it
contains odd number of 1’s, and 0 is added if it contains even number of 1’s This scheme makes the total number of 1’s even, that is why it is called even
parity checking.

3. Two-dimensional Parity check


Parity check bits are calculated for each row, which is equivalent to a simple parity check bit. Parity check bits are also calculated for all columns, then
both are sent along with the data. At the receiving end these are compared with the parity bits calculated on the received data
7. Explain Checksums of error-detecting code with an example.

Checksum
 In checksum error detection scheme, the data is divided into k segments each of m bits.
 In the sender’s end the segments are added using 1’s complement arithmetic to get the sum. The sum
is complemented to get the checksum.
 The checksum segment is sent along with the data segments.
 At the receiver’s end, all received segments are added using 1’s complement arithmetic to get the
sum. The sum is complemented.
 If the result is zero, the received data is accepted; otherwise discarded.
8.Explain Cyclic Redundancy Checks of error-detecting code with an example.

Cyclic redundancy check (CRC)

 Unlike checksum scheme, which is based on addition, CRC is based on binary division.

 In CRC, a sequence of redundant bits, called cyclic redundancy check bits, are appended to the end of data unit so that the resulting data unit becomes
exactly divisible by a second, predetermined binary number.

 At the destination, the incoming data unit is divided by the same number. If at this step there is no remainder, the data unit is assumed to be correct and is
therefore accepted.

 A remainder indicates that the data unit has been damaged in transit and therefore must be rejected.
9.A bit stream 10011101 is transmitted using the standard CRC method described in the text. The

generator polynomial is x

3 + 1. Show the actual bit string transmitted. Suppose the third bit from the

left is inverted during transmission. Show that this error is detected at the receiver's end.
ans :
The frame is 10011101. The generator is 1001. The message after appending three zeros is

10011101000. The remainder on dividing 10011101000 by 1001 is 100. So, the actual bit string

transmitted is 10011101100. The received bit stream with an error in the third bit from the left is

10111101100. Dividing this by 1001 produces a remainder 100, which is different from zero. Thus,

the receiver detects the error and can ask for a retransmission

10. What is the remainder obtained by dividing x 7 + x 5 + 1 by the generator polynomial x 3 + 1? Svar: The remainder is -x 2 + x + 1
11. A message 1001 1100 1010 0011 is transmitted using the Internet Checksum (using 4-bit words). What is the value of the
checksum?

Answer: Adding the 4-bit words yields 1001 + 1100 + 1010 + 0011 = 100010. The carry is added to the LSBs: 0100. The
one’s complement value is then 1011, which is the checksum. And indeed, the check works out as expected. Adding the data
and the checksum yields 1001 + 1100 + 1010 + 0011 + 1011 = 101101, which gives 1111 (carry) and thus 0000 (negation).
0011 + 1010 = 1101

1101 + 1100 = 1001 + 1 = 1010

1010 + 1001 = 0011 + 1 = 0100.

So, the Internet checksum is the ones complement of 0100, or 1011

12. .Explain elementary data link protocols.

Simplest Protocol:

It is very simple. The sender sends a sequence of frames without even thinking about the receiver. Data are transmitted in one
direction only. Both sender & receiver always ready. Processing time can be ignored. Infinite buffer space is available. And
best of all, the communication channel between the data link layers never damages or loses frames. This thoroughly
unrealistic protocol, which we will nickname ‘‘Utopia,’’ .The utopia protocol is unrealistic because it does not handle either
flow control or error correction
NOISY CHANNELS:

Although the Stop-and-Wait Protocol gives us an idea of how to add flow control to its predecessor, noiseless channels are
nonexistent. We can ignorethe error (as we sometimes do), or we need to add error control to ourprotocols. We discuss three
protocols in this section that use error control.

13. .Explain Sliding Window protocol.

1. Stop-and-Wait Automatic RepeatRequest

2. Go-Back-N Automatic RepeatRequest

3. Selective Repeat Automatic Repeat Request

1 A stop-and-wait ARQ sender sends one frame at a time; it is a special case of the general sliding window protocol with
transmit and receive window sizes equal to one in both cases.

 Used in Connection-oriented communication.

 It offers error and flows control

 It is used in Data Link and Transport Layers

 Stop and Wait for ARQ mainly implements the Sliding Window Protocol concept with Window Size

 2. Go-Back-N Automatic Repeat Request

Go-Back-N protocol, also called Go-Back-N Automatic Repeat reQuest, is a data link layer protocol that uses a sliding
window method for reliable and sequential delivery of data frames. In this protocol we can send several frames before
receiving acknowledgments; we keep a copy of these frames until the acknowledgments arrive.

Suppose there are a sender and a receiver, and let's assume that there are 11 frames to be sent. These frames are represented as
0,1,2,3,4,5,6,7,8,9,10, and these are the sequence numbers of the frames. Mainly, the sequence number is decided by the
sender's window size. But, for the better understanding, we took the running sequence numbers, i.e., 0,1,2,3,4,5,6,7,8,9,10.
Let's consider the window size as 4, which means that the four frames can be sent at a time before expecting the
acknowledgment of the first frame
Step 1: Firstly, the sender will send the first four frames to the receiver, i.e., 0,1,2,3, and now the sender is expected to receive
the acknowledgment of the 0th frame.

Let's assume that the receiver has sent the acknowledgment for the 0 frame, and the receiver has successfully received it

The sender will then send the next frame, i.e., 4, and the window slides containing four frames (1,2,3,4).

The receiver will then send the acknowledgment for the frame no 1. After receiving the acknowledgment, the sender will send
the next frame, i.e., frame no 5, and the window will slide having four frames (2,3,4,5).
Now, let's assume that the receiver is not acknowledging the frame no 2, either the frame is lost, or the acknowledgment is
lost. Instead of sending the frame no 6, the sender Go-Back to 2, which is the first frame of the current window, retransmits all
the frames in the current window, i.e., 2,3,4,5.

Advantages of Go-Back-N ARQ

Given below are some of the advantages of Go Back N ARQ.


1. It can send multiple frames at once. 2. Pipelining is present in the Go-Back-N ARQ i.e. a frame can be sent by the
sender before receiving the acknowledgment of the previously sent frame. This results in a lesser waiting time for the
frame. 3. It handles corrupted as well as out-of-order frames which result in minimal frame loss.

1. The size of the sender window in Go Back N ARQ is equal to N.


2. The size of the receiver window in Go Back N ARQ is equal to 1.

important points related to Go-Back-N ARQ:

o In Go-Back-N, N determines the sender's window size, and the size of the receiver's window is always 1.
o It does not consider the corrupted frames and simply discards them.
o It does not accept the frames which are out of order and discards them.
o If the sender does not receive the acknowledgment, it leads to the retransmission of all the current window frames.

Timers Although there can be a timer for each frame that is sent, in our protocol weuse only one. The reason is that
the timer for the first outstanding frame always expires first; we send all outstanding frames when thistimer expires.
Acknowledgment The receiver sends a positive acknowledgment if a frame has arrived safe andsound and in order.
If a frame is damaged or is received out of order, the receiver is silent and will discard all subsequent frames until it
receives the one it is expecting. The silence of the receiver causes the timer of the unacknowledged frame at the
sender side to expire. This, in turn, causes the sender to go back and resend all frames, beginning with the one with
the expired timer. The receiver does not have to acknowledge each frame received. It can send one cumulative
acknowledgment for several frames.Resending a Frame When the timer expires, the sender resends all outstanding
frames. For example, suppose the sender has already sent frame 6, but the timer forframe 3 expires. This means that
frame 3 has not been acknowledged; the sender goes back and sends frames 3,4,5, and 6 again. That is why the
protocol is called Go-Back-N ARQ. https://www.javatpoint.com/go-back-n-arq

11. .Explain a protocol using Selective Repeat.

Selective Repeat ARQ


It is also known as Sliding Window Protocol and used for error detection and control in the data link layer.
In the selective repeat, the sender sends several frames specified by a window size even without the need to wait for
individual acknowledgement from the receiver as in Go-Back-N ARQ. In selective repeat protocol, the retransmitted frame
is received out of sequence.
In Selective Repeat ARQ only the lost or error frames are retransmitted, whereas correct frames are received and buffered.
The receiver while keeping track of sequence numbers buffers the frames in memory and sends NACK for only frames
which are missing or damaged. The sender will send/retransmit a packet for which NACK is received.
n the selective repeat ARQ, both the sender and the receiver have windows of the same size. The window on the
sender's side covers the sequence of data packets that are sent (or to be sent). On the other hand, the window on the
receiver's side covers the sequence of data packets that are received (or to be received).

The size of the sender's window is 2^(m-1), where m is the number of bits used in the header of the packet to express
the packet's sequence number. The window size of the receiver is the same as that of the sender i.e. 2^(m-1). The
sender's window size is represented using Ws and the receiver's window size is represented using Wr.

The steps of data transmission can be:

1. The sender sends frames 0 and 1.


2. The receiver receives the frames and sends back ACK 0 and ACK 1.
3. Again the sender sends the frames 2 and 3.
4. The receiver only receives the frame 3. So it sends back NACK 2 which means that the 2nd frame is lost and needs
to be re-transmitted.
5. So, the sender sends back the frame 2 and this process is continued till all the frames have been received by the
receiver.

`````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````

Unit 3

1.What is store-and-forward packet switching?

Store-and-forward switching is a method of switching data packets by the switching device that receives the data frame and
then checks for errors before forwarding the packets. It supports the efficient transmission of non-corrupted frames. It is
generally used in telecommunication networks.

In store-and-forward switching, the switching device waits to receive the entire frame and then stores the frame in the buffer
memory. Then the frame is checked for errors by using CRC(Cyclic Redundancy Check) if the error is found then the packet
is discarded else it is forwarded to the next device

in the above diagram, we can see that the Internet Service Provider (ISP) has six routers (A to F) connected by transmission
lines shown in blue lines. There are two hosts, host H1 is connected to router A, while host H2 is connected to router D.
Suppose that H1 wants to send a data packet to H2. H1 sends the packet to router A. The packet is stored in router A until it
has arrived fully. Router A verifies the checksum using CRC (cyclic redundancy check) code. If there is a CRC error, the
packet is discarded, otherwise it is transmitted to the next hop, here router F. The same process is followed by router F which
then transmits the packet to router D. Finally router D delivers the packet to host H2.

Advantage: Store − and forward packet switching ensures high quality data packet transmission. Since erroneous packets are
discarded at each router, bad packets or invalid packets in the network are mostly eliminated
2.Write the various services offered by the network layer to the transport layer.

Services provided to transport layer

The network layer provides services to the transport layer at the network layer/transport layer interface. The services need to
be carefully designed with the following goals in mind:

Services independent of router technology.


Transport layer shielded from number, type, topology of routers.
Network addresses available to transport layer use uniform numbering plan even across LANs and WANs

3.What is routing algorithm?

o The routing protocol is a routing algorithm that provides the best path from the source to the destination. The best
path is the path that has the "least-cost path" from source to the destination.
o Routing is the process of forwarding the packets from source to the destination but the best route to send the packets
is determined by the routing algorithm

properties are desirable in a routing algorithm correctness, simplicity, robustness, stability, fairness, optimality

4.Expand MPLS , CIDR.

MPLS (MultiProtocol Label Switching)

CIDR (Classless InterDomain Routing),

5. Compare between Virtual-Circuit networks and Datagram networks.


6.What is broadcast routing?

In some applications, hosts need to send messages to many or all other hosts. Sending a packet to all destinations
simultaneously is called broadcasting and the routing used for this is called broadcast routing.

For example, a service distributing weather reports, stock market updates, or live radio programs might work best by sending
to all machines and letting those that are interested read the data.

6.What is multicast routing?

We need a way to send messages to well-defined groups that are numerically large in size but small
compared to the network as a whole.
Sending a message to such a group is called multicasting, and the routing algorithm used is called
multicast routing
Multicast routing schemes build on the broadcast routing schemes
All multicasting schemes require some way to create and destroy groups and to identify which routers
are members of a group.

7. What is anycast routing?

In anycast, a packet is delivered to the nearest member of a group. Schemes that find these paths are called anycast routing.
1. It provides faster connection by decreasing the number of hops and reducing latency.
2. Load balancing can be utilized easily.

8. What is Congestion?

A state occurring in network layer when the message traffic is so heavy that it slows down network response
time. Too many packets present in (a part of) the network causes packet delay and loss that degrades
performance. However, the most effective way to control congestion is to reduce the load that
the transport layer is placing on the network.

10.List the approaches to congestion control.


The presence of congestion means that the load is greater than the resources can handle
Two solutions come to mind: increase the resources or decrease the load
The most basic way to avoid congestion is to build a network that is well matched to the
traffic that it carries
Splitting traffic across multiple paths is called traffic-aware routing.
11. .List the principles of network layer in the internet.
Make sure it works.
Keep it simple
Make clear choices.

Look for a good design; it need not be perfect

Consider performance and cost

Think about scalability

12. List the different options for Option field in IPv4 protocol.

Option Description

Security Specifies how secret the datagram is

Strict source routing Gives the complete path to be followed

Loose source routing Gives a list of routers not to be missed


Record route Makes each router append its IP address

Timestamp Makes each router append its address and timestamp

13. What is IP address ? Give example.

An IP address represents a unique address that distinguishes any device on the internet or any network from
another.An IP address is the identifier that enables your device to send or receive data packets across the internet. It holds
information related to your location and therefore making devices available for two-way communication.

Eg An IP address is represented by a series of numbers segregated by periods(.). They are expressed in the form of four pairs
- an example address might be 255.255.255.255 wherein each set can range from 0 to 255

14. What is meant by subnetting and subnets?

the networks (such as Ethernet LANs) that result from dividing up a larger network are called subnets.

When a bigger network is divided into smaller networks, to maintain security, then that is known as Subnetting. So,
maintenance is easier for smaller networks.

15. What is meant by route aggregation and supernet

combine multiple small prefixes into a single larger prefix. This process is called route aggregation. n Supernetting, multiple
networks are combined into a bigger network termed as a Supernetwork or Supernet

16. Expand NAT , SIPP.


SIPP (Simple Internet Protocol Plus)

NAT ( Network Address Translation)

17. List different special IP addresses

This host

A host on this network

Broadcast on the local network

Broadcast on a distant network


Loopback

18. What are the major goals of IPv6?

19. List different extension headers of IPv6

Extension header Description

Hop-by-hop options Miscellaneous information for routers

Destination options Additional information for the destination

Routing Loose list of routers to visit

Fragmentation Management of datagram fragments

Authentication Verification of the sender’s identity

Encrypted security payload Information about the encrypted contents


20. List the Internet control protocols====

21. Expand ICMP, ARP, DHCP.

IMCP—The Internet Control Message Protocol

ARP (Address Resolution Protocol)

DHCP (Dynamic Host Configuration Protocol)

22. List the different ICMP message types.

Message type Description

Destination unreachable Packet could not be delivered

Time exceeded Time to live field hit 0

Parameter problem Invalid header field

Source quench Choke packet

Redirect Teach a router about geography

Echo and echo reply Check if a machine is alive

Timestamp request/reply Same as Echo, but with timestamp

Router advertisement/solicitation Find a nearby route

nk

23. What is ARP?

Address Resolution Protocol (ARP) is a protocol or procedure that connects an ever-changing Internet Protocol (IP) address
to a fixed physical machine address, also known as a media access control (MAC) address, in a local-area network (LAN).
24. Multiprotocol Label Switching (MPLS) is data forwarding technology that increases the speed and controls the flow of
network traffic. With MPLS, data is directed through a path via labels instead of requiring complex lookups in a routing table
at every stop. This feature helps in increasing the delivery rate of IP packets.

25. Expand OSPF, BGP

OSPF (Open Shortest Path First)

BGP (Border Gateway Protocol).

26.List the different types of OSPF message.

Message type Description

Hello Used to discover who the neighbors are

Link state update Provides the sender’s costs to its neighbors

Link state ack Acknowledges link state update

Database description Announces which updates the sender has

Link state request Requests information from the partner

````````````````````````````````````````````````````````````````````````````````````````````````````````````````

1,Explain the implementation of connectionless service.

If connectionless service is offered, packets are injected into the network individually and, routed independently of each
other. No advance setup is needed. In this context, the packets are frequently called datagrams (in analogy with telegrams)
and the network is called a datagram network.
A’s table (initially) A’s table (later) C’s Table E’s Table

Let us assume for this example that the message is four times longer than the maximum packet
size, so the network layer has to break it into four packets, 1, 2, 3, and 4, and send each of them
in turn to router A.
Every router has an internal table telling it where to send packets for each of the possible
destinations. Each table entry is a pair(destination and the outgoing line). Only directly connected
lines can be used.
A’s initial routing table is shown in the figure under the label ‘‘initially.’’
At A, packets 1, 2, and 3 are stored briefly, having arrived on the incoming link. Then each packet
is forwarded according to A’s table, onto the outgoing link to C within a new frame. Packet 1 is
then forwarded to E and then to F.
However, something different happens to packet 4. When it gets to A it is sent to router B, even
though it is also destined for F. For some reason (traffic jam along ACE path), A decided to send
packet 4 via a different route than that of the first three packets. Router A updated its routing
table, as shown under the label ‘‘later.’’
The algorithm that manages the tables and makes the routing decisions is called the routing
algorithm.

2.Explain the implementation of connection-oriented service


A’s table C’s Table E’s Table

If connection-oriented service is used, a path from the source router all the way to the destination router must be established
before any data packets can be sent. This connection is called a VC (virtual circuit), and the network is called a virtual-circuit
network

When a connection is established, a route from the source machine to the destination machine is chosen as part o f the
connection setup and stored in tables inside the routers. That route is used for all traffic flowing over the connection, exactly
the same way that the telephone system works. When the connection is released, the virtual circuit is also terminated. With
connection-oriented service, each packet carries an identifier telling which virtual circuit it belongs to.

As an example, consider the situation shown in Figure. Here, host H1 has established connection 1 with host H2. This
connection is remembered as the first entry in each of the routing tables. The first line of A’s table says that if a packet
bearing connection identifier 1 comes in from H1, it is to be sent to router C and given connection identifier 1. Similarly, the
first entry at C routes the packet to E, also with connection identifier 1.

Now let us consider what happens if H3 also wants to establish a connection to H2. It chooses
connection identifier 1 (because it is initiating the connection and this is its only connection) and
tells the network to establish the virtual circuit.

This leads to the second row in the tables. Note that we have a conflict here because although A can easily distinguish
connection 1 packets from H1 from connection 1 packets from H3, C cannot do this. For this reason, A assigns a different
connection identifier to the outgoing traffic for the second connection. Avoiding conflicts of this kind is why routers need
the ability to replace connection identifiers in outgoing packets.

In some contexts, this process is called label switching. An example of a connection-oriented network service is MPLS (Multi
Protocol Label Switching)

3.Explain the concept of Flooding

Flooding is a non-adaptive routing technique following this simple method: when a data packet arrives at a router, it is sent
to all the outgoing links except the one it has arrived on

Types of Flooding

Flooding may be of three types −

 Uncontrolled flooding − Here, each router unconditionally transmits the incoming data packets to all its neighbours.
 Controlled flooding − They use some methods to control the transmission of packets to the neighbouring nodes. The
two popular algorithms for controlled flooding are Sequence Number Controlled Flooding (SNCF) and Reverse Path
Forwarding (RPF).

Advantages of Flooding

 It is very simple to setup and implement, since a router may know only its neighbours.
 It is extremely robust. Even in case of malfunctioning of a large number routers, the packets find a way to reach the
destination.
 All nodes which are directly or indirectly connected are visited. So, there are no chances for any node to be left out.
This is a main criteria in case of broadcast messages.
 The shortest path is always chosen by flooding.

Limitations of Flooding

 Flooding tends to create an infinite number of duplicate data packets, unless some measures are adopted to damp
packet generation.
 It is wasteful if a single destination needs the packet, since it delivers the data packet to all nodes irrespective of the
destination.
 The network may be clogged with unwanted and duplicate data packets. This may hamper delivery of other data
packets
For example, let us consider the network in the figure, having six routers that are connected through transmission lines
Using flooding technique −

 An incoming packet to A, will be sent to B, C and D.


 B will send the packet to C and E.
 C will send the packet to B, D and F.
 D will send the packet to C and F.
 E will send the packet to F.
 F will send the packet to C and E.

3.Explain Distance vector routing with an example

In distance-vector routing (DVR), each router is required to inform the topology changes to its neighboring routers
periodically. Historically it is known as the old ARPNET routing algorithm or Bellman-Ford algorithm

How the DVR Protocol Works

 In DVR, each router maintains a routing table. It contains only one entry for each router. It contains two parts − a
preferred outgoing line to use for that destination and an estimate of time (delay). Tables are updated by exchanging
the information with the neighbor’s nodes.
 Each router knows the delay in reaching its neighbors (Ex − send echo request).
 Routers periodically exchange routing tables with each of their neighbors.
 It compares the delay in its local table with the delay in the neighbor’s table and the cost of reaching that neighbor.
 If the path via the neighbor has a lower cost, then the router updates its local table to forward packets to the neighbor.

Example – Consider 3-routers X, Y and Z as shown in figure. Each router have their routing table. Every routing table will
contain distance to the destination nodes.
Consider router X , X will share it routing table to neighbors and neighbors will share it routing table to it to X and distance
from node X to destination will be calculated using bellmen- ford equation.

Dx(y) = min { C(x,v) + Dv(y)} for each node y ∈ N

As we can see that distance will be less going from X to Z when Y is intermediate node(hop) so it will be update in routing
table X.

Similarly for Z also


Finally the routing table for all –


7,Explain Count to infinity with an example

The settling of routes to best paths across the network is called convergence. Distance vector routing is useful as a simple
technique by which routers can collectively compute shortest paths, but it has a serious drawback in practice: although it
converges to the correct answer, it may do so slowly. In particular, it reacts rapidly to good news, but leisurely to bad
news.

Consider a router whose best route to destination X is long. If, on the next exchange, neighbor A suddenly reports a short
delay to X, the router just switches over to using the line to A to send traffic to X. In one vector exchange, the good news
is processed. To see how fast good news propagates, consider the five-node (linear) network of Fig. 5-10, where the delay
metric is the number of hops. Suppose A is down initially and all the other routers know this. In other words, they have
all recorded the delay to A as infinity

8. . Explain Link state routing with an example.


Link state routing is based on the assumption that, although the global knowledge about the topology is not clear,
each node has partial knowledge: it knows the state (type, condition, and cost) of its links. In other words, the
whole topology can be compiled from the partial knowledge of each node.
Building Routing Tables

Creation of the states of the links by each node, called the link state packet (LSP).
Dissemination of LSPs to every other router, called flooding, in an efficient and reliable way.
Formation of a shortest path tree for each node.
Calculation of a routing table based on the shortest path tree

Creation of Link State Packet (LSP) A link state packet can carry a large amount of information. For the moment,
we assume that it carries a minimum amount of data: the node identity, the list of links, a sequence number, and age.
The first two, node identity and the list of links, are needed to make the topology. The third, sequence number,
facilitates flooding and distinguishes new LSPs from old ones. The fourth, age, prevents old LSPs from remaining
in the domain for a long time.

2.Flooding of LSPs: After a node has prepared an LSP, it must be disseminated to all othernodes, not only to its neighbors.
The process is called flooding and based on the following

The creating node sends a copy of the LSP out of each interface A node that receives an LSP compares it with the copy it
may already have. If the newly arrived LSP is older than the one it has (found by checking the sequence number),it discards
the LSP

3, Formation of Shortest Path Tree: Dijkstra Algorithm

A shortest path tree is a tree in which the path between the root and every other node is the shortest. The Dijkstra algorithm
creates a shortest path tree from a graph. The algorithm divides the nodes into two sets: tentative and permanent. It finds
the neighbors of a current node, makes them tentative, examines them, and if they pass the criteria, makes them permanent.
4.Calculation of a routing table

routing table for node A

9. Explain hierarchical routing with an example.

In hierarchical routing, the routers are divided into regions. Each router has complete details about how to route packets to
destinations within its own region. But it does not have any idea about the internal structure of other regions.
As we know, in both LS and DV algorithms, every router needs to save some information about other routers. When network
size is growing, the number of routers in the network will increase. Therefore, the size of routing table increases, then routers
cannot handle network traffic as efficiently. To overcome this problem we are using hierarchical routing.
In hierarchical routing, routers are classified in groups called regions. Each router has information about the routers in its
own region and it has no information about routers in other regions. So, routers save one record in their table for every other
region.
11.Explain the approaches to congestion control

 The presence of congestion means that the load is greater than the
resources can handle
 Two solutions come to mind: increase the resources or decrease the load
 The most basic way to avoid congestion is to build a network that is
well matched to the traffic that it carries.
 Sometimes resources can be added dynamically like routers and links when there is
serious congestion. This is called provisioning, and which happens on a timescale of
months, driven by long-term trends.
 Splitting traffic across multiple paths is called traffic-aware routing.
 In a virtual-circuit network, new connections can be refused if they
would cause the network to become congested. This is called admission
control.

Splitting traffic across multiple paths is called traffic-aware routing.

In a virtual-circuit network, new connections can be refused if they would cause the network to become congested.
This is called admission control.

When all else fails, the network is forced to discard packets that it cannot deliver. The general name for this is load
shedding
Traffic-Aware Routing

The goal in taking load into account when computing routes is to shift traffic away from hotspots that will be the
first places in the network to experience congestion. The most direct way to do this is to set the link weight to
be a
function of the (fixed) link bandwidth and propagation delay plus the (variable)
measured load or average queuing delay

Admission Control

In a virtual-circuit network, new connections can be refused if they would cause the network
to become congested. This is called admission control. The idea is simple: do not set up a new
virtual circuit unless the network can carry the added traffic without becoming congested. Thus,
attempts to set up a virtual circuit may fail.

Traffic that varies while browsing the Web is more difficult to handle because the bursts of
Web traffic are more likely to congest routers in the network. A commonly used descriptor that
captures this effect is the leaky bucket or token bucket.

Suppose that a host attached to router A wants to set up a connection to a host attached
to router B. Normally, this connection would pass through one of the congested routers.
To avoid this situation, we can redraw the network as shown in Fig. 5-24(b), omitting
the congested routers and all of their lines. The dashed line shows a possible route for the virtual
circuit that avoids the congested routers.

10. List and explain the principles of network layer in the internet

1. Make sure it works. Do not finalize the design or standard until multiple prototypes have
successfully communicated with each other. All too often, designers first write a 1000-page
standard, get it approved, then discover it is deeply flawed and does not work. Then they write
version 1.1 of the standard. This is not the way to go.

2. Keep it simple. When in doubt, use the simplest solution. William of Occam stated this
principle (Occam’s razor) in the 14th century. Put in modern terms: fight features. If a feature
is not absolutely essential, leave it out, especially if the same effect can be achieved by
combining other features.

3. Make clear choices. If there are several ways of doing the same thing, choose one. Having
two or more ways to do the same thing is looking for trouble.

4. Exploit modularity. This principle leads directly to the idea of having protocol stacks, each
of whose layers is independent of all the other ones. In this way, if circumstances require one
module or layer to be changed, the other ones will not be affected.

5. Expect heterogeneity. Different types of hardware, transmission facilities, and applications


will occur on any large network. To handle them, the network design must be simple, general,
and flexible.

6. Avoid static options and parameters. If parameters are unavoidable (e.g., maximum packet
size), it is best to have the sender and receiver negotiate a value rather than defining fixed
choices.

7. Look for a good design; it need not be perfect. Often, the designers have a good design but
it cannot handle some weird special case. Rather than messing up the design, the designers
should go with the good design and put the burden of working around it on the people with the
strange requirements.

8. Be strict when sending and tolerant when receiving. In other words, send only packets that
rigorously comply with the standards, but expect incoming packets that may not be fully
conformant and try to deal with them.
9. Think about scalability. If the system is to handle millions of hosts and billions of users
effectively, no centralized databases of any kind are tolerable and load must be spread as evenly
as possible over the available resources.

10. Consider performance and cost. If a network has poor performance or outrageous costs,
nobody will use it.

11. With a neat diagram explain the format of IP version 4 protocol.

IPv4 is version 4 of IP. It is a current version and the most commonly used IP address. It is a
32-bit address written in four numbers separated by a dot (.), i.e., periods. This address is unique
for each device. For example, 66.94.29.13

 Version − Version no. of Internet Protocol used (e.g. IPv4).


 IHL − Internet Header Length; Length of entire IP header.
 DSCP − Differentiated Services Code Point; this is Type of Service.
 ECN − Explicit Congestion Notification; It carries information about the congestion seen in
the route.
 Total Length − Length of entire IP Packet (including IP header and IP Payload).
 Identification − If IP packet is fragmented during the transmission, all the fragments contain
same identification number. to identify original IP packet they belong to.
 Flags − As required by the network resources, if IP Packet is too large to handle, these ‘flags’
tells if they can be fragmented or not. In this 3-bit flag, the MSB is always set to ‘0’.
 Fragment Offset − This offset tells the exact position of the fragment in the original IP
Packet.
 Time to Live − To avoid looping in the network, every packet is sent with some TTL value
set, which tells the network how many routers (hops) this packet can cross. At each hop, its
value is decremented by one and when the value reaches zero, the packet is discarded.
 Protocol − Tells the Network layer at the destination host, to which Protocol this packet
belongs to, i.e. the next level Protocol. For example protocol number of ICMP is 1, TCP is 6
and UDP is 17.
 Header Checksum − This field is used to keep checksum value of entire header which is
then used to check if the packet is received error-free.
 Source Address − 32-bit address of the Sender (or source) of the packet.
 Destination Address − 32-bit address of the Receiver (or destination) of the packet.
 Options − This is optional field, which is used if the value of IHL is greater than 5. These options may contain
values for options such as Security, Record Route, Time Stamp, etc.

13..Explain Classful addressing


Classful addressing is a concept that divides the available address space of IPv4 into five
classes namely A, B, C, D & E.
 The first three classes, Class A, B, and C, are used for "public addressing", in which
communication is always one-to-one between source and destination. It implies that
 when data is transmitted from a source, it will only be sent to a single network host.
 The reserved categories include Class D and Class E, with Class D being utilized for
multicast and Class E being saved for future usage exclusively.
 In IPv4, the Network ID is the first part of Class A, B, and C, while the Host ID is the
remaining second portion.
 The Host ID always indicates the number of hosts or nodes in a certain network,
whereas the Network ID always identifies the network in a specific place.
 In Class A, B, and C, the address space is split into a certain number of IP address
blocks. It also specifies the maximum number of hosts in a network.

Class A
In class A, the first 8 bits are for the network part of the address, and the remaining 24 bits are reserved for
the host part of the address. The leading first bit of the octet is fixed.

Class A IP addressing

We subtract two addresses from the network addresses since they are considered special addresses.

Usable addresses are as follows:

 Network addresses 2^7−2=126


 Host addresses 2^24−2=16,777,214
Class A is used for large-sized networks.

Class B

In class B, the first 16 bits are for the network part of the address, and the remaining 16 bits are reserved
for the host part of the address. The leading first two bits of the octet are fixed.

Class B IP addressing

Usable addresses are as follows:

 Network addresses 2^14=16384

 Host addresses 2^16–2=65534

Class B is used for medium-sized networks.

Class C

In class C, the first 24 bits are for the network part of the address, and the remaining 8 bits are reserved for
the host part of the address. The leading first three bits of the octet are fixed.

Class C IP addressing

Usable addresses are as follows:

 Network addresses 2^21=2097152

 Host addresses 2^8-2=254

Class C is used for small-sized networks.

Class D

Class D is reserved for multicasting. Higher-order bits of the octet are set as 11101110.

IP address belonging to class D are reserved for multi-casting. The higher order bits of the first octet of IP
addresses belonging to class D are always set to 1110. The remaining bits are for the address that interested
hosts recognize.
Class E

Class E is reserved for experiment and research purposes. Higher-order bits of the octet are set
as11111111.

IP addresses belonging to class E are reserved for experimental and research purposes. IP
addresses of class E ranges from 240.0.0.0 – 255.255.255.254. This class doesn’t have any
sub-net mask. The higher order bits of first octet of class E are always set to 1111

14. .Briefly explain Network Address Translation

Network Address Translation(NAT) is a process of assigning a unique public IP address to


represent an entire group of computers. In Network Address Translation, a network device,
typically a router or NAT firewall — assigns a public address to one or more devices
connected to a private network.
Advantages of Network Address Translation
 NAT connects various hosts to the global internet using a smaller number of public
(external) IP addresses, thereby conserving IP address space.
 NAT keeps internal addresses hidden from the outside network and improves security
for private networks.
 Network Address Translation provides a private IPv4 addressing scheme and avoids
modifying your internal addresses if your service provider changes.
 Adding a new client to the local network environment with NAT is simpler since local
devices are privately addressed.
Working of nat

The working of NAT begins with configuring the network router or NAT firewall, for the
network translation to take place. The network router has an interface that acts as a
connection between the inside (local) network, and the outside (global) network.

The inside network address has to go through the router for the translation process and gets
converted to an outside globally recognized IP address to access internet services and the
same translation process when moving from outside network to inside network.

16.With a neat diagram explain the format of IP version 6 protocol

 Version: It is a four-bit field that defines the version number of the IP. IP6 version is
6, IP4 version is 4.
 Priority: It is a 4-bit priority field that defines the priority of the packet with respect
to traffic congestion that a packet is to reject or not.
 Flow Label: It is three bytes or 24-bit field designed to provide special handling for a
particular flow of data to speed flow on an already flowing packet path.
 Payload Length: It is a two-byte payload length field that defines the total length of
the IP datagram, excluding the base header.
 Next Header: It is an 8-bit field that defines the header that follows the base header
in the datagram. In IPV4, this field is called a protocol. Some of the values in this
field indicate options that are
source Address: This field is 16-byte which specifies the original source of the datagram
destination address. This is a 16-byte internet address that usually identifies the final
destination of the datagram.
Hop Limit (8-bits): Hop Limit field is the same as TTL in IPv4 packets. It indicates the
maximum number of intermediate nodes IPv6 packet is allowed to travel. Its value gets
decremented by one, by each node that forwards the packet and the packet is discarded if the
value decrements to 0. This is used to discard the packets that are stuck in an infinite loop
because of some routing error
Destination Address (128-bits): The destination Address field indicates the IPv6 address of
the final destination(in most cases). All the intermediate nodes can use this information in
order to correctly route the packet.
Extension Headers: In order to rectify the limitations of the IPv4 Option Field, Extension
Headers are introduced in IP version 6. The extension header mechanism is a very important
part of the IPv6 architecture. The next Header field of IPv6 fixed header points to the first
Extension Header and this first extension header points to the second extension header and so
on.
1.Explain Internet Control Message Protocol.
The ICMP stands for Internet Control Message Protocol. It is a network layer protocol. It is
used for error handling in the network layer, and it is primarily used on network devices such
as routers. As different types of errors can exist in the network layer, so ICMP can be used to
report these errors and to debug those errors.
For example, some sender wants to send the message to some destination, but the router
couldn't send the message to the destination. In this case, the router sends the message to the
sender that I could not send the message to that destination
Types of ICMP messages
 Information Messages − In this message, the sender sends a query to the host or
router and expects an answer. For example, A host wants to know if a router is alive
or not.
 Error-reporting message − This message report problems that a router or a host
(destination) may encounter when it processes an IP packet.
 Query Message − It helps a router or a network manager to get specific information
from a router or another host
 format

 Type − The type field identifies the type of the message.


 Code − The code field in ICMP describes the purpose of the message.
 Checksum − The checksum field is used to validate ICMP messages.(refer also22)

3. Explain Address Resolution Protocol.


Address Resolution Protocol (ARP) is a communication protocol used to find the MAC
(Media Access Control) address of a device from its IP address. This protocol is used when a
device wants to communicate with another device on a Local Area Network or Ethernet.
Types of ARP
There are four types of Address Resolution Protocol, which is given below:
o Proxy ARP
o Gratuitous ARP
o Reverse ARP (RARP)
o Inverse ARP

Proxy ARP - Proxy ARP is a method through which a Layer 3 devices may respond to ARP
requests for a target that is in a different network from the sender. The Proxy ARP configured
router responds to the ARP and map the MAC address of the router with the target IP address
and fool the sender that it is reached at its destination
Gratuitous ARP - Gratuitous ARP is an ARP request of the host that helps to identify the
duplicate IP address. It is a broadcast request for the IP address of the router
o The gratuitous ARP is used to update the ARP table of other devices.
o It also checks whether the host is using the original IP address or a duplicate one
Reverse ARP (RARP) - It is a networking protocol used by the client system in a local area
network (LAN) to request its IPv4 address from the ARP gateway router table. A table is
created by the network administrator in the gateway-router that is used to find out the MAC
address to the corresponding IP address.
Inverse ARP (InARP) - Inverse ARP is inverse of the ARP, and it is used to find the IP
addresses of the nodes from the data link layer addresses. These are mainly used for the
frame relays, and ATM networks, where Layer 2 virtual circuit addressing are often acquired
from Layer 2 signaling. When using these virtual circuits, the relevant Layer 3 addresses are
available
3 .Explain Dynamic Host Configuration Protocol.
Dynamic Host Configuration Protocol (DHCP) is a network management protocol used to
dynamically assign an IP address to nay device, or node, on a network so they can
communicate using IP (Internet Protocol). DHCP automates and centrally manages these
configurations. There is no need to manually assign IP addresses to new devices. Therefore,
there is no requirement for any user configuration to connect to a DHCP based network.
Benefits of DHCP
There are following benefits of DHCP:
Centralized administration of IP configuration: DHCP IP configuration information can
be stored in a single location and enables that administrator to centrally manage all IP address
configuration information.
Dynamic host configuration: DHCP automates the host configuration process and
eliminates the need to manually configure individual host. When TCP/IP (Transmission
control protocol/Internet protocol) is first deployed or when IP infrastructure changes are
required.
Seamless IP host configuration: The use of DHCP ensures that DHCP clients get accurate
and timely IP configuration IP configuration parameter such as IP address, subnet mask,
default gateway, IP address of DND server and so on without user intervention.
Flexibility and scalability: Using DHCP gives the administrator increased flexibility,
allowing the administrator to move easily change IP configuration when the infrastructure
changes.
Components of DHCP
When working with DHCP, it is important to understand all of the components. Following
are the list of components:
o DHCP Server: DHCP server is a networked device running the DCHP service that
holds IP addresses and related configuration information. This is typically a server or
a router but could be anything that acts as a host, such as an SD-WAN appliance.
o DHCP client: DHCP client is the endpoint that receives configuration information
from a DHCP server. This can be any device like computer, laptop, IoT endpoint or
anything else that requires connectivity to the network. Most of the devices are
configured to receive DHCP information by default.
o IP address pool: IP address pool is the range of addresses that are available to DHCP
clients. IP addresses are typically handed out sequentially from lowest to the highest.
o Subnet: Subnet is the partitioned segments of the IP networks. Subnet is used to keep
networks manageable.
o Lease: Lease is the length of time for which a DHCP client holds the IP address
information. When a lease expires, the client has to renew it.
2.Explain OSPF -an interior gateway protocol.
The OSPF stands for Open Shortest Path First. It is a widely used and supported routing
protocol. It is an intradomain protocol, which means that it is used within an area or a
network. It is an interior gateway protocol that has been designed within a single autonomous
system. It is based on a link-state routing algorithm in which each router contains the
information of every domain, and based on this information, it determines the shortest path.

There are five different types of packets in OSPF:


o Hello
o Database Description
o Link state request
o Link state update
o Link state Acknowledgment
Let's discuss each packet in detail.
1. Hello packet
The Hello packet is used to create a neighborhood relationship and check the neighbor's
reachability. Therefore, the Hello packet is used when the connection between the routers
need to be established.
2. Database Description
After establishing a connection, if the neighbor router is communicating with the system first
time, it sends the database information about the network topology to the system so that the
system can update or modify accordingly.
3. Link state request
The link-state request is sent by the router to obtain the information of a specified route.
Suppose there are two routers, i.e., router 1 and router 2, and router 1 wants to know the
information about the router 2, so router 1 sends the link state request to the router 2. When
router 2 receives the link state request, then it sends the link-state information to router 1.
4. Link state update
The link-state update is used by the router to advertise the state of its links. If any router
wants to broadcast the state of its links, it uses the link-state update.
5. Link state acknowledgment
The link-state acknowledgment makes the routing more reliable by forcing each router to
send the acknowledgment on each link state update. For example, router A sends the link
state update to the router B and router C, then in return, the router B and C sends the link-
state acknowledgment to the router A, so that the router A gets to know that both the routers
have received the link-state update.
There are four types of links in OSPF:
1. Point-to-point link: The point-to-point link directly connects the two routers without
any host or router in between.
2. Transient link: When several routers are attached in a network, they are known as a
transient link.
The transient link has two different implementations:
Unrealistic topology:
Realistic topology:
3. Stub link: It is a network that is connected to the single router. Data enters to the
network through the single router and leaves the network through the same router.
4. Virtual link: If the link between the two routers is broken, the administration creates
the virtual path between the routers, and that path could be a long one also.
5.Explain BGP- an exterior gateway protocol.
it is an interdomain routing protocol, and it uses the path-vector routing. It is a gateway
protocol that is used to exchange routing information among the autonomous system on the
internet.
The following are the features of a BGP protocol:
o Open standard
It is a standard protocol which can run on any window device.
o Exterior Gateway Protocol
It is an exterior gateway protocol that is used to exchange the routing information between
two or more autonomous system numbers.
o InterAS-domain routing
It is specially designed for inter-domain routing, where interAS-domain routing means
exchanging the routing information between two or more autonomous number system.
o Supports internet
It is the only protocol that operates on the internet backbone.
o Classless
It is a classless protocol.
o Incremental and trigger updates
Like IGP, BGP also supports incremental and trigger updates.
o Path vector protocol
The BGP is a path vector protocol. Here, path vector is a method of sending the routes along
with routing information.
o Configure neighborhood relationship
It sends updates to configure the neighborhood relationship manually. Suppose there are two
routers R1 and R2. Then, R1 has to send the configure command saying that you are my
neighbor. On the other side, R2 also has to send the configure command to R1, saying that R1
is a neighbor of R1. If both the configure commands match, then the neighborhood
relationship will get developed between these two routers.
o Application layer protocol
It is an application layer protocol and uses TCP protocol for reliability.
o Metric
It has lots of attributes like weight attribute, origin, etc. BGP supports a very rich number of
attributes that can affect the path manipulation process.
o Administrative distance
If the information is coming from the external autonomous system, then it uses 20
administrative distance. If the information is coming from the same autonomous system, then
it uses 200 administrative distance.
4. .Explain broadcasting and multicasting.
Broadcast routing
By default, the broadcast packets are not routed and forwarded by the routers on any network.
Routers create broadcast domains. But it can be configured to forward broadcasts in some
special cases. A broadcast message is destined to all network devices.
Broadcast routing can be done in two ways (algorithm):
 A router creates a data packet and then sends it to each host one by one. In this case,
the router creates multiple copies of single data packet with different destination
addresses. All packets are sent as unicast but because they are sent to all, it simulates
as if router is broadcasting.
This method consumes lots of bandwidth and router must destination address of each node.
 Secondly, when router receives a packet that is to be broadcasted, it simply floods
those packets out of all interfaces. All routers are configured in the same way.

his method is easy on router's CPU but may cause the problem of duplicate packets received
from peer routers.
Reverse path forwarding is a technique, in which router knows in advance about its
predecessor from where it should receive broadcast. This technique is used to detect and
discard duplicates.
Multicast Routing
Multicast routing is special case of broadcast routing with significance difference and
challenges. In broadcast routing, packets are sent to all nodes even if they do not want it. But
in Multicast routing, the data is sent to only nodes which wants to receive the packets.

The router must know that there are nodes, which wish to receive multicast packets (or
stream) then only it should forward. Multicast routing works spanning tree protocol to avoid
looping.
Multicast routing also uses reverse path Forwarding technique, to detect and discard
duplicates and loops.
4. Anycast Routing
Anycast packet forwarding is a mechanism where multiple hosts can have same logical
address. When a packet destined to this logical address is received, it is sent to the host which
is nearest in routing topology
Anycast routing is done with help of DNS server. Whenever an Anycast packet is received it
is enquired with DNS to where to send it. DNS provides the IP address which is the nearest
IP configured on it

2 .Differentiate IPV4 and IPV6 protocol.

Checksum field The checksum field is available in IPv4. The checksum field is not
available in IPv6.

Address In IPv4, the IP address is In IPv6, the representation of the IP


representation represented in decimal. address in hexadecimal.

3.Explain any 5 ICMP Message Types.


Destination Unreachable Message –
The host/router send this message if it is not able to route the IP packet
to its destination.
For example, sender A wants to send the datagram to receiver B but it
is not received by B then the intermediate router will discard the
datagram and send the destination unreachable message to A
Time Exceeded Message –
The host/router sends this message if it decrements the time to live
value of the datagram to zero or the destination address does not
receive all the packets in the specified time interval.
For example, a packet is sent from a layer having 1000 units to the
layer having 200 units, then the packet is divided into five fragments.
If all the fragments don’t reach the destination in a set time, all
fragments are discarded and the time-exceeded message is sent to the
original source.
Parameter Problem Message –
The host/router sends this message if some parameter is not properly
set in the datagram. It is used to indicate errors in the header field of
the datagram
Source Quench Message –
Host/router send this message if there is congestion in the network or
the source is sending packets at a higher rate which the router can’t
handle.
For example, if sender A is sending the data packets at a high data rate
which the router is unable to handle then it will discard the packet and
send a source quench message to A to tell it to send the packets at a
lower rate. Now, after receiving the message A will either stop or slow
down sending of the packets.
 Redirection Message –
The host/router sends this message to update the routing table of the host.
For example, sender A wants to send the message to receiver B and there is a router
between them. Then, A sends the data to the router and the router sends the message
to B and redirection message to A so that A can update its routing table.
Echo-Request and Reply Message –
It is used by the network managers to check the operations of the IP protocol and host’s
reachability. The host/router sends the echo request message, while the
echo reply message is sent by the host/router that receives an echo
request message.
For example, host A wants to check whether it can communicate with another host B so it
will send an echo-request to B and if there is a link between A and B
and B is active then it will send echo-reply to A on receiving the
request.
Timestamp Request and Reply Message –
It is used to determine the round trip time taken by each IP datagram to
travel from one host to another host. It can also synchronize the clocks
between hosts if transit time is known.
For example, host A wants to synchronize its clock with B then it will
ask time on B’s clock by sending timestamp request and B will reply
with the timestamp to A. Then A will add the time and propagation
delay to synchronize the time on its system.
 Router Solicitation and Advertisement Message –
It is used to confirm the presence of a router on the local area network. It is done by
broadcasting a router solicitation message and the router that receives the message
broadcasts the routing information using a router advertisement message.
For example, if host A wants to get the information of routers present on the network.
It will broadcast a router solicitation message to request routers to advertise their
presence and in response router on the network will announce its IP address available
for routing through advertisement message.
6.Explain IPV6 extension headers.
In IPv6, the Fixed Header contains only that much information which is necessary,
avoiding those information which is either not required or is rarely used. All such
information is put between the Fixed Header and the Upper layer header in the
form of Extension Headers. Each Extension Header is identified by a distinct value.
Hop-by-Hop EH is used for the support of Jumbo-grams or, with the Router Alert
option, it is an integral part in the operation of MLD. Router Alert [3] is an integral
part in the operations of IPv6 Multicast through Multicast Listener Discovery (MLD)
and RSVP for IPv6.
• Destination EH is used in IPv6 Mobility as well as support of certain applications.
• Routing EH is used in IPv6 Mobility and in Source Routing. It may be necessary to
disable "IPv6 source routing" on routers to protect against DDoS.
• Fragmentation EH is critical in support of communication using fragmented
packets (in IPv6, the traffic source must do fragmentation-routers do not perform
fragmentation of the packets they forward)
• Mobility EH is used in support of Mobile IPv6 service
• Authentication EH is similar in format and use to the IPv4 authentication header
defined in RFC2402 [4].
• Encapsulating Security Payload EH is similar in format and use to the IPv4 ESP
header defined in RFC2406 [5]. All information following the Encapsulating Security
Header (ESH) is encrypted and for that reason, it is inaccessible to intermediary
network devices. The ESH can be followed by an additional Destination Options EH
and the upper layer datagram.

````````````````````````````````````````````````````````````````````````````````````````````````````````````````
Unit 4

1.Write the various services offered by the transport layer


o End-to-end delivery
o Addressing
o Reliable delivery
o Flow control
o Multiplexing
2. Expand TSAP, NSAP
TSAP (Transport Service Access Point)
NSAP (Network Service Access Point)
3.What is Portmapper?
A port mapper is the protocol that maps the number or version of an Open Network
Computing Remote Procedure Call (ONC RPC) program to a port used for networking
by that version of the program
4. List the two main protocols in transport layer.
 USER DATAGRAM PROTOCOL (UDP)
 TRANSMISSION CONTROL PROTOCOL (TCP)
5.What is error control?
error control in data link layer is the process of detecting and correcting data frames
that have been corrupted or lost during transmission.
6.What is flow control?
Flow control is used to prevent the sender from overwhelming the receiver. If the receiver is
overloaded with too much data, then the receiver discards the packets and asking for the
retransmission of packets. This increases network congestion and thus, reducing the system
performance.

6. Draw a neat diagram of UDP diagram

7. Expand RPC , RTP

RPC (Remote Procedure Call)

RTP (Real-time Transport Protocol)


8.What is TCP?

o TCP stands for Transmission Control Protocol.

o It provides full transport layer services to applications.

o It is a connection-oriented protocol means the connection established between both the ends
of the transmission. For creating the connection, TCP generates a virtual circuit between
sender and receiver for the duration of a transmission

9.Expand PAWS , SACK

PAWS (Protection Against Wrapped Sequence numbers)

SACK (Selective ACKnowledgement)

10. List the states used in TCP connection management finite state machine

State Description

CLOSED No connection is active or pending

LISTEN The server is waiting for an incoming call

SYN RCVD A connection request has arrived; wait for ACK

SYN SENT The application has started to open a connection

ESTABLISHED The normal data transfer state

FIN WAIT 1 The application has said it is finished

FIN WAIT 2 The other side has agreed to release

TIME WAIT Wait for all packets to die off

CLOSING Both sides have tried to close simultaneously

CLOSE WAIT The other side has initiated a release

LAST ACK Wait for all packets to die off

11. .Expand DNS , ICANN.

ICANN (Internet Corporation for Assigned Names and Numbers).

DNS (Domain Name System)

12. How DNS is used?

UDP is preferred because it is fast and has low overhead. A DNS query is a single UDP request from
the DNS client followed by a single UDP reply from the server.

13.List the different DNS resource record types.

Type Meaning Value

SOA Start of authority Parameters for this zone

A IPv4 address of a host 32-Bit integer


AAAA IPv6 address of a host 128-Bit integer

MX Mail exchange Priority, domain willing to accept email

NS Name server Name of a server for this domain

CNAME Canonical name Domain name

PTR Pointer Alias for an IP address

SPF Sender policy framework Text encoding of mail sending policy

SRV Service Host that provides it

TXT Text Descriptive ASCII text

14. What is Name resolution?

Name resolution is the process of associating names and IP addresses, and it's one of the most
essential services on a network. People understand descriptive names, but network
communications require difficult-to-remember addresses

15. Expand SMTP, MIME.

SMTP (Simple Mail Transfer Protocol)

MIME ( Multipurpose Internet Mail Extension)

1, What are the two kinds of subsystems of Email system.

: the user agents, which allow people to read and send email

the message transfer agents, which move the messages from the source to the destination.

2, .What is meant by User agent?

A user agent is any software that retrieves, renders and facilitates end user interaction with Web
content, or whose user interface is implemented using Web technologies

3, List the different header fields related to message transport in RFC 5322.

Header Meaning

To: Email address(es) of primary recipient(s)

Cc: Email address(es) of secondary recipient(s)

Bcc: Email address(es) for blind carbon copies

From: Person or people who created the message

Sender: Email address of the actual sender

Received: Line added by each transfer agent along the route

4, .List the different message headers added by MIME.


Header Meaning

MIME-Version: Identifies the MIME version

Content-Description: Human-readable string telling what is in the message

Content-Id: Unique identifier

Content-Transfer-Encoding: How the body is wrapped for transmission

Content-Type: Type and format of the content

5, List different SMTP extensions

Keyword Description

AUTH Client authentication

BINARYMIME Server accepts binary messages

CHUNKING Server accepts large messages in chunks

SIZE Check message size before trying to send

STARTTLS Switch to secure transport (TLS; see Chap. 8)

UTF8SMTP Internationalized addresse

6, Expand IMAP , SOAP.

IMAP ( Internet Message Access Protocol)

SOAP ( Simple Object Access Protocol)

7, .List different IMAP commands

SELECT Select a folder

EXAMINE Select a read-only folder

CREATE Create a folder

DELETE Delete a folder

RENAME Rename a folder

SUBSCRIBE Add folder to active set

UNSUBSCRIBE Remove folder from active set

LIST List the available folders

8, What is Webmail?

web-based email system that allows you to access and use your email from almost anywhere
through an internet connection. it does not need software installation. It is a kind of service, which
is provided by certain companies and ISPs (Internet service providers).

9, Expand HTTP , URL

HTTP(HyperText Transfer Protocol)


URL(Uniform Resource Locator)

10, URI ( Uniform Resource Identifier)

URN (Uniform Resource Name)

HTML HyperText Markup Language)

CSS ( Cascading Style Sheet)

CGI (Common Gateway Interface)

"PHP: Hypertext Preprocessor"

. JSP(JavaServer Pages)

AJAX—Asynchronous JavaScript and XML

DOM ( Document Object Model)

XML (eXtensible Markup Language)

XSLT ( eXtensible Stylesheet Language Transformation)

XHTML (eXtended HyperText MarkupLanguage)

1.List different HTTP message headers.

Header Type Contents

User-Agent Request Information about the browser and its platform

Accept Request The type of pages the client can handle

Expires Response Time and date when the page stops being valid

Location Response Tells the client where to send its request

2,Draw a neat diagram of HTTP caching.


````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````` ```````````

1.Explain Elements of Transport protocol.

ELEMENTS OF TRANSPORTPROTOCOLS

The transport service is implemented by a transport protocol used between the two transport
entities.

Addressing

Connection Establishment

Connection Release

Error control and Flow Control

addressing

o According to the layered model, the transport layer interacts with the functions of the
session layer. Many protocols combine session, presentation, and application layer
protocols into a single layer known as the application layer. In these cases, delivery to the
session layer means the delivery to the application layer. Data generated by an application
on one machine must be transmitted to the correct application on another machine. In this
case, addressing is provided by the transport layer.

o The transport layer provides the user address which is specified as a station or port. The
port variable represents a particular TS user of a specified station known as a Transport
Service access point (TSAP). Each station has only one transport entity.
A possible scenario for a transport connection is as follows:

1. A mail server process attaches itself to TSAP 1522 on host 2 to wait

for an incoming call. How a process attaches itself to a TSAP is outside the networking model and
depends entirely on the local operating system. A call such as our LISTEN might be used, for example.

2. An application process on host 1 wants to send an email message, so it attaches itself to TSAP
1208 and issues a CONNECT request. Therequest specifies TSAP 1208 on host 1 as the source and
TSAP 1522on host 2 as the destination. This action ultimately results in a transport connection being
established between the application process and the server.

3. The application process sends over the mail message.

4. The mail server responds to say that it will deliver the message.

5. The transport connection is released.

. Explain the process tcp of connection establishment in Transport layer.


to make the transport services reliable, TCP hosts must establish a connection-oriented session with
one another. Connection establishment is performed by using the three-way handshake
mechanism. A three-way handshake synchronizes both ends of a network by enabling both sides to
agree upon original sequence numbers.
This mechanism also provides that both sides are ready to transmit data and learn that the other
side is available to communicate. This is essential so that packets are not shared or retransmitted
during session establishment or after session termination. Each host randomly selects a sequence
number used to track bytes within the stream it is sending and receiving.

Handshake refers to the process to establish connection between the client and server. Handshake
is simply defined as the process to establish a communication link. To transmit a packet, TCP needs
a three way handshake before it starts sending data. The reliable communication in TCP is termed
as PAR (Positive Acknowledgement Re-transmission). When a sender sends the data to the receiver,
it requires a positive acknowledgement from the receiver confirming the arrival of data. If the
acknowledgement has not reached the sender, it needs to resend that data. The positive
acknowledgement from the receiver establishes a successful connection.

Step 1: SYN
SYN is a segment sent by the client to the server. It acts as a connection
request between the client and server. It informs the server that the client wants to
establish a connection. Synchronizing sequence numbers also helps synchronize
sequence numbers sent between any two devices, where the same SYN segment asks
for the sequence number with the connection request.

Step 2: SYN-ACK
It is an SYN-ACK segment or an SYN + ACK segment sent by the server. The ACK
segment informs the client that the server has received the connection request and it
is ready to build the connection. The SYN segment informs the sequence number with
which the server is ready to start with the segments.

Step 3: ACK
ACK (Acknowledgment) is the last step before establishing a successful TCP connection
between the client and server. The ACK segment is sent by the client as the response
of the received ACK and SN from the server. It results in the establishment of a reliable
data connection.
After these three steps, the client and server are ready for the data communication
process. TCP connection and termination are full-duplex, which means that the data
can travel in both the directions simultaneously.

Explain the process of connection establishment in Transport layer

Establishing a connection sounds easy, but it is actually surprisingly tricky. At first glance, it
would seem sufficient for one transport entity to just send a CONNECTION REQUEST
segment to the destination and wait for a CONNECTION ACCEPTED reply. The problem
occurs when the networkcan lose, delay, corrupt, and duplicate packets. This behavior causes
seriouscomplications.

To solve this specific problem,(DELAYED DUPLICATES) Tomlinson (1975)introduced the


three-way handshake. This establishment protocol involves one peer checking with the other
that the connection request is indeed current. The normal setup procedure when host 1 initiates
is shown in Fig. (a). Host 1 chooses a sequence number, x, and sends a CONNECTION
REQUEST segment containing it to host 2. Host 2 replies with an ACK segment
acknowledging x and announcing its own initial sequence number, y. Finally, host 1
acknowledges host 2’s choice of an initial sequence number in the first data segment that it
sends.

handshake.CR denotes CONNECTION REQUEST. a) Normal operation, b) Old


CONNECTION REQUEST appearing out of nowhere. c) Duplicate CONNECTION
REQUEST and duplicate ACK.

In Fig.(b), the first segment is a delayed duplicate CONNECTION REQUEST from an old
connection. This segment arrives at host 2 without host 1’s knowledge. Host 2 reacts
to this segment by sending host 1 an ACK segment, in effect asking for verification
that host 1 was indeed trying to set up a new connection. When host 1 rejects host 2’s
attempt to establish a connection, host 2 realizes that it was tricked by a delayed
duplicate and abandons the connection. In this way, a delayed duplicate does no
damage

The worst case is when both a delayed CONNECTION REQUEST and an ACK are
floating around in the subnet. This case is shown in Fig. (c). As in the previous example,
host 2 gets a delayed CONNECTION REQUESTand replies to it. At this point, it is crucial
to realize that host 2 has proposed using y as the initial sequence number for host 2
to host 1 traffic, knowing full well that no segments containing sequence number y or
acknowledgements to y are still in existence. When the second delayed segment
arrives at host 2, the fact that z has been acknowledged rather than y tells host 2 that
this, too, is an old duplicate. The important thing to realize here is that there is no
combination of old segments that can cause the protocol to fail and have a connection
set up by accident when no one wants it.

Explain the process of connection release in Transport layer

There are two styles of terminating a connection: asymmetric release and symmetric release
Asymmetric release is the way the telephone system works: when one party hangs up, the
connection is broken. Symmetric release treats the connection as two separate unidirectional
connections and requires each one to be released separately

Asymmetric release is abrupt and may result in data loss. Consider the scenario of Fig. After
the connection is established, host 1 sends a segment that arrives properly at host 2. Then host
1 sends another segment. Unfortunately, host 2 issues a DISCONNECT before the second
segment arrives. The result is that the connection is released and data are lost

Clearly, a more sophisticated release protocol is needed to avoid data loss. One way is to use
symmetric release, in which each direction is released independently of the other one. Here, a
host can continue to receive data even after it has sent a DISCONNECT segment. Symmetric
release does the job when each process has a fixed amount of data to send and clearly knows
when it has sent it. One can envision a protocol in which host 1 says ‘‘I am done. Are you done
too?’’ If host 2 responds: ‘‘I am done too. Goodbye, the connection can be safely released.’’
In Fig. (a), we see the normal case in which one of the users sends a DR (DISCONNECTION
REQUEST) segment to initiate the connection release. When itarrives, the recipient sends back
a DR segment and starts a timer, just in case its DR is lost. When this DR arrives, the original
sender sends back an ACK segment and releases the connection. Finally, when the ACK
segment arrives, the receiver also releases the connection.

If the final ACK segment is lost, as shown in Fig.(b), the situationis saved by the timer. When
the timer expires, the connection is released anyway. Now consider the case of the second DR
being lost. The user initiating the disconnection will not receive the expected response, will
time out, and will start all over again.

In Fig.(c), we see how this works, assuming that the second time no segments are lost and all
segments are delivered correctlyand on time. Last scenario, Fig.(d), is the same as Fig. (c)
except that now we assume all the repeated attempts to retransmit the DR also fail due to lost
segments. After N retries, the sender just gives up and releases the connection.

.Explain the process of TCP connection release

While it creates three segments to establish a connection, it takes four segments to terminate a
connection. During a TCP connection is full-duplex (that is, data flows in each direction
independently of the other direction), each direction should be shut down alone.

The termination procedure for each host is shown in the figure. The rule is that either end can
share a FIN when it has finished sending data.
When a TCP receives a FIN, it should notify the application that the other end has terminated
that data flow direction. The sending of a FIN is usually the result of the application issuing a
close.

The receipt of a FIN only means that there will be no more data flowing in that
direction. A TCP can send data after receiving a FIN. The end that first issues the close
(example, send the first FIN) executes the active close. The other end (that receives this
FIN) manages the passive close.

With a neat diagram explain User Datagram Protocol.

The User Datagram Protocol (UDP) is simplest Transport Layer communication protocol
available of the TCP/IP protocol suite. It involves minimum amount of communication
mechanism. UDP is said to be an unreliable transport protocol but it uses IP services which
provides best effort delivery mechanism.

UDP Header –

UDP header is an 8-bytes fixed and simple header, while for TCP it may vary from 20
bytes to 60 bytes. The first 8 Bytes contains all necessary header information and the
remaining part consist of data. UDP port number fields are each 16 bits long, therefore
the range for port numbers is defined from 0 to 65535; port number 0 is reserved. Port
numbers help to distinguish different user requests or processes

1. Source Port: Source Port is a 2 Byte long field used to identify the
port number of the source.
2. Destination Port: It is a 2 Byte long field, used to identify the port
of the destined packet.
3. Length: Length is the length of UDP including the header and the
data. It is a 16-bits field.
4. Checksum: Checksum is 2 Bytes long field. It is the 16-bit one’s
complement of the one’s complement sum of the UDP header, the
pseudo-header of information from the IP header, and the data,
padded with zero octets at the end (if necessary) to make a multiple
of two octets.
Explain the technique of Remote Procedure Call

A remote procedure call is an interprocess communication technique that is used for client-
server based applications. It is also known as a subroutine call or a function call.
A client has a request message that the RPC translates and sends to the server. This request
may be a procedure or a function call to a remote server. When the server receives the request,
it sends the required response back to the client. The client is blocked while the server is
processing the call and only resumed execution after the server is finished.
The sequence of events in a remote procedure call are given as follows −

 The client stub is called by the client.


 The client stub makes a system call to send the message to the server and puts the
parameters in the message.
 The message is sent from the client to the server by the client’s operating system.
 The message is passed to the server stub by the server operating system.
 The parameters are removed from the message by the server stub.
 Then, the server procedure is called by the server stub.

Explain Real Time Transport Protocol.

A protocol is designed to handle real-time traffic (like audio and video) of the Internet,
is known as Real Time Transport Protocol (RTP). RTP must be used with UDP. It does
not have any delivery mechanism like multicasting or port numbers. RTP supports
different formats of files like MPEG and MJPEG. It is very sensitive to packet delays and
less sensitive to packet loss.

The first word contains the Version field

 The P bit indicates that the packet has been padded to a multiple of 4 bytes. The
last padding byte tells how many bytes were added

.  The X bit indicates that an extension header is present.

 The CC field tells how many contributing sources are present, from 0 to 15 (see
below). The M bit is an application-specific marker bit

.  The Payload type field tells which encoding algorithm has been used

 The Sequence number is just a counter that is incremented on each RTP packet sent.
It is used to detect lost packets

.  The Timestamp is produced by the stream’s source to note when the first sample in
the packet was made.

 Synchronization source identifier tells which stream the packet belongs to

 the Contributing source identifiers, if any, are used when mixers are present in the
studio. In that case, the mixer is the synchronizing source, and the streams being mixed
are listed here.

Explain TCP service model.

In TCP service, the sender and receiver needs to create endpoints called sockets. Each socket
has an address which is made up of two parts.
 An IP address of the host.
 A port number that is 16 bit local to host (source or destination)
Both are collectively called socket addresses. A port is the TCP name for TSAP (Transport
Service Access Point). It is essential to create a link between the sockets of the sender &
receiver. Connections are used as identifiers at both ends. It can use the same socket for greater
than one connection at a time.
We explain some of the sockets calls with their respectful meaning in the following table. It
also should know that TCP does not support multicasting & broadcasting.

With a neat diagram explain TCP segment header.

Every TCP segment consists of a 20 byte fixed format header. Header options may
follow the fixed header. With a header so that it can tag up to 65535 data bytes
Source Port
It is a 16-bit source port number used by the receiver to reply.

Destination Port
It is a 16-bit destination port number.

Sequence Number
The sequence number of the first data byte in this segment. During the SYN Control bit is set,
and the sequence number is n, and the first data byte is n + 1.

Acknowledgement Number
If the ACK control bit is set, this field contains the next number that the receiver expects to
receive.

Data Offset
The several 32-bit words in the TCP header shows from where the user data begins.

Reserved (6 bit)
It is reserved for future use.

URG
It indicates an urgent pointer field that data type is urgent or not.
ACK
It indicates that the acknowledgement field in a segment is significant, as discussed early.

PUSH
The PUSH flag is set or reset according to a data type that is sent immediately or not.

RST It Resets the connection.


SYN
It synchronizes the sequence number.
FIN
This indicates no more data from the sender.

Window
It is used in Acknowledgement segment. It specifies the number of data bytes, beginning with
the one indicated in the acknowledgement number field that the receiver is ready to accept.

Checksum
It is used for error detection.

Options
The IP datagram options provide additional punctuality. It can use several optional parameters
between a TCP sender and receiver. It depends on the options used. The length of the field
may vary in size, but it can't be larger than 40 bytes due to the header field's size, which is 4
bit.

Explain the process of TCP sliding window

TCP uses a sliding window, to handle flow control. The sliding window protocol used by 22
TCP, however, is something between the Go-Back-N andSelective Repeat sliding window. The
sliding window protocol in TCP looks like the Go-Back-N protocol because it does not use
NAKs;it looks like Selective Repeat because the receiver holds the out-of-order segments until
the missing ones arrive.

There are two big differences between this sliding window and the onewe used at the data link
layer.

1 the sliding window of TCP is byte-oriented; the one we discussed in thedata link layer is
frame-oriented.

2.the TCP's sliding window is of variable size; the one we discussed inthe data link layer was
of fixed size
The window is opened, closed, or shrunk. These three activities, as we willsee, are in the control
ofthe receiver (and depend on congestion in the network), not the sender.

The sender must obey the commands of the receiver in this matter. Opening a window means
moving the right wall to the right. This allowsmore new bytes in the buffer that are eligible for
sending.

Closing the window means moving the left wall to the right. This meansthat some bytes have
been acknowledged and the sender need not worry about them anymore. Shrinking the window
means moving the right wall to the left.

The size of the window at one end is determined by the lesser of two values: receiver window
(rwnd) or congestion window (cwnd).

The receiver window is the value advertised by the opposite end in a segment containing
acknowledgment. It is the number of bytes the other end can accept before its buffer overflows
and data are discarded. The congestion window is a value determined by the network to avoid
congestion
.Explain the architecture of Email system

Electronic Mail (e-mail) is one of most widely used services of Internet. This
service allows an Internet user to send a message in formatted manner (mail) to
the other Internet user in any part of world. Message in mail not only contain
text, but it also contains images, audio and videos data. The person who is
sending mail is called sender and person who receives mail is called recipient. It
is just like postal mail service.
1. User Agent (UA) : The UA is normally a program which is used to send and
receive mail. Sometimes, it is called as mail reader. It accepts variety of
commands for composing, receiving and replying to messages as well as
for manipulation of the mailboxes.
2. Message Transfer Agent (MTA) : MTA is actually responsible for transfer
of mail from one system to another. To send a mail, a system must have
client MTA and system MTA. It transfer mail to mailboxes of recipients if
they are connected in the same machine. It delivers mail to peer MTA if
destination mailbox is in another machine. The delivery from one MTA to
another MTA is done by Simple Mail Transfer Protocol.

Mailbox : It is a file on local hard drive to collect mails. Delivered mails are
present in this file. The user can read it delete it according to his/her requirement.
To use e-mail system each user must have a mailbox . Access to mailbox is only
to owner of mailbox.

Spool file : This file contains mails that are to be sent. User agent appends
outgoing mails in this file using SMTP. MTA extracts pending mail from spool
file for their delivery. E-mail allows one name, an alias, to represent several
different e-mail addresses. It is known as mailing list,

Message Access Agent


The Simple Mail Transfer Protocol is used for the first and second stages of e-mail
delivery.
The pull protocol is mainly required at the third stage of e-mail delivery, and the
message access agent is used at this point.
POP and IMAP4 are the two protocols used to access messages.

Explain the format of Internet message

Electronic Mail (e-mail) is one of the most widely used services of the Internet.
This service allows an Internet user to send a message in a formatted manner
(mail) to other Internet users in any part of the world. Message in the mail not
only contain text, but it also contains images, audio and videos data. The person
who is sending mail is called sender and person who receives mail is called the
recipient. It is just like postal mail service.

. Header :
The header consists of a series of lines. Each header field consists of a single line
of ASCII text specifying field name, colon and value. The main header fields
related to message transport are :

1. To: It specifies the DNS address of the primary recipient(s).


2. Cc : It refers to carbon copy. It specifies address of secondary recipient(s).
3. BCC: It refers to blind carbon copy. It is very similar to Cc. The only
difference between Cc and Bcc is that it allow user to send copy to the
third party without primary and secondary recipient knowing about this.
4. From : It specifies name of person who wrote message.
5. Sender : It specifies e-mail address of person who has sent message.
6. Received : It refers to identity of sender’s, data and also time message was
received. It also contains the information which is used to find bugs in
routing system.
7. Return-Path: It is added by the message transfer agent. This part is used
to specify how to get back to the sender

Header Meaning

Date: The date and time the message was sent

Reply-To: Email address to which replies should be sent

Message-Id: Unique number for referencing this message later


In-Reply-To: Message-Id of the message to which this is a reply

References: Other relevant Message-Ids

Keywords: User-chosen keywords

Subject: Short summary of the message for the one-line display

Note on mime

MIME stands for Multipurpose Internet Mail Extensions. It is used to extend the
capabilities of Internet e-mail protocols such as SMTP.MIME is a kind of add-on
or a supplementary protocol that allows non-ASCII data to be sent through
SMTP. It allows the users to exchange different kinds of data files on the Internet:
audio, video, images, application programs as well.

MIME Header

MIME adds five additional fields to the header portion of the actual e-mail to
extend the properties of the simple email protocol. These fields are as follows:

1. MIME Version

It defines the version of the MIME protocol. This header usually has a parameter value
1.0, indicating that the message is formatted using MIME.

2. Content Type

It describes the type and subtype of information to be sent in the message. These
messages can be of many types such as Text, Image, Audio, Video, and they also have
many subtypes such that the subtype of the image can be png or jpeg. Similarly, the
subtype of Video can be WEBM, MP4 etc.

3. Content Type Encoding

In this field, it is told which method has been used to convert mail information into
ASCII or Binary number, such as 7-bit encoding, 8-bit encoding, etc.

4. Content Id

In this field, a unique "Content Id" number is appended to all email messages so that
they can be uniquely identified.

5. Content description
This field contains a brief description of the content within the email. This means that
information about whatever is being sent in the mail is clearly in the "Content
Description". This field also provides the information of name, creation date, and
modification date of the file.

Features of MIME Protocol

1. It supports multiple attachments in a single e-mail.


2. It supports the non-ASCII characters.
3. It supports unlimited e-mail length.
4. It supports multiple languages

Advantage of the MIME


The MIME protocol has the following advantages:

1. It is capable of sending various types of files in a message, such as text, audio,


video files.
2. It also provides the facility to send and receive emails in different languages like
Hindi, French, Japanese, Chinese etc.
3. It also provides the facility of connecting HTML and CSS to email, due to which
people can design email as per their requirement and make it attractive and
beautiful.
4. It is capable of sending the information contained in an email regardless of its
length.
5. It assigns a unique id to all e-mails.

.Write a note on SMTP.

SMTP

o SMTP stands for Simple Mail Transfer Protocol.


o SMTP is a set of communication guidelines that allow software to
transmit an electronic mail over the internet is called Simple Mail
Transfer Protocol.
o It is a program used for sending messages to other computer users based
on e-mail addresses.
o It provides a mail exchange between users on the same or different
computers, and it also supports:
o It can send a single message to one or more recipients.
o Sending message can include text, voice, video or graphics.
o It can also send the messages on networks outside the internet.
o The main purpose of SMTP is used to set up communication rules
between servers. The servers have a way of identifying themselves and
announcing what kind of communication they are trying to perform.
They also have a way of handling the errors such as incorrect email
address. For example, if the recipient address is wrong, then receiving
server reply with an error message of some kind

Working of SMTP
1. Composition of Mail: A user sends an e-mail by composing an electronic mail
message using a Mail User Agent (MUA). Mail User Agent is a program which is used
to send and receive mail. The message contains two parts: body and header. The body
is the main part of the message while the header includes information such as the
sender and recipient address. The header also includes descriptive information such as
the subject of the message. In this case, the message body is like a letter and header is
like an envelope that contains the recipient's address.
2. Submission of Mail: After composing an email, the mail client then submits the
completed e-mail to the SMTP server by using SMTP on TCP port 25.
3. Delivery of Mail: E-mail addresses contain two parts: username of the recipient and
domain name. For example, vivek@gmail.com, where "vivek" is the username of the
recipient and "gmail.com" is the domain name.
If the domain name of the recipient's email address is different from the sender's
domain name, then MSA will send the mail to the Mail Transfer Agent (MTA). To relay
the email, the MTA will find the target domain. It checks the MX record from Domain
Name System to obtain the target domain. The MX record contains the domain name
and IP address of the recipient's domain. Once the record is located, MTA connects to
the exchange server to relay the message.
4. Receipt and Processing of Mail: Once the incoming message is received, the
exchange server delivers it to the incoming server (Mail Delivery Agent) which stores
the e-mail where it waits for the user to retrieve it.
5. Access and Retrieval of Mail: The stored email in MDA can be retrieved by using MUA
(Mail User Agent). MUA can be accessed by using login and password

Advantages of SMTP:
 If necessary, the users can have a dedicated server.
 It allows for bulk mailing.
 Low cost and wide coverage area.
 Offer choices for email tracking.
 reliable and prompt email delivery.
.Write a note on IMAP.

is an application layer protocol that operates as a contract for


receiving emails from the mail server. It was designed by Mark
Crispin in 1986 as a remote access mailbox protocol, the current
version of IMAP is IMAP4. It is used as the most commonly used
protocol for retrieving emails. This term is also known as Internet
mail access protocol, Interactive mail access protocol, and
Interim mail access protocol.

Features of IMAP :

 It is capable of managing multiple mailboxes and


organizing them into various categories.
 Provides adding of message flags to keep track of which
messages are being seen.
 It is capable of deciding whether to retrieve email from a
mail server before downloading.
 It makes it easy to download media when multiple files are
attached
advantage

 It offers synchronization across all the maintained sessions


by the user.
 It provides security over POP3 protocol as the email only
exists on the IMAP server.
 Users have remote access to all the contents.
 It offers easy migration between the devices as it is
synchronized by a centralized server.
 There is no need to physically allocate any storage to save
contents

Write a note on World Wide Web

 The World Wide Web (WWW) is a collection of


documents and other web resources which are
identified by URLs, interlinked by hypertext links, and
can be accessed and searched by browsers via the
Internet.

 Website is a collection of web pages belonging to a particular


organization.
 The pages can be retrieved and viewed by using browser.
Components of the Web: There are 3 components of the web:

1. Uniform Resource Locator (URL): serves as a system for


resources on the web.
2. HyperText Transfer Protocol (HTTP): specifies
communication of browser and server.
3. Hyper Text Markup Language (HTML): defines the
structure, organisation and content of a webpage.

Client (Browser):

 Web browser is a program, which is used to communicate with web


server on the Internet.
 Each browser consists of three parts: a controller, client protocol and
interpreter.
 The controller receives input from input device and use the programs
to access the documents.
 After accessing the document, the controller uses one of the
interpreters to display the document on the screen

Server:

 A computer which is available for the network resources and provides


service to the other computer on request is known as server.
 The web pages are stored at the server.
 Server accepts a TCP connection from a client browser.
 It gets the name of the file required.
 Server gets the stored file. Returns the file to the client and releases
the top connection

Uniform Resource Locater (URL)

 The URL is a standard for specifying any kind of information on the


Internet.
 The URL consists of four parts: protocol, host computer, port and
path.
 The protocol is the client or server program which is used to retrieve
the document or file. The protocol can be ftp or http.
 The host is the name of computer on which the information is located.
 The URL can optionally contain the port number and it is separated
from the host name by a colon.
 Path is the pathname of the file where the file is stored.
Write a note on Static webpages.

Static Web pages:

Static Web pages are very simple. It is written in languages


such as HTML, JavaScript, CSS, etc. For static web pages
when a server receives a request for a web page, then the
server sends the response to the client without doing any
additional process. And these web pages are seen through a
web browser. In static web pages, Pages will remain the same
until someone changes it manually
advantage
 Static websites are highly cost-effective for publishing.
 They require less coding and technical knowledge.
 Static websites are easier to make.
 Static websites are quick to develop.
 Static websites are cheap to host.
 A static website contains data which is immutable.
 Static websites are beginner level. A programmer with knowledge
of HTML, CSS, and JavaScript can build static websites.
 It’s easy to create and host online.
 Static websites provide security.

Features of Static Websites:

 Static websites are the simplest kind of website that you


can build.
 Every viewer will see the exactly same text, multimedia
design or video every time he/she visits the website
until you alter that page’s source code.
 Static websites are written with the help of HTML and
CSS.
 The only form of interactively on a static website
is hyperlink.
 Static website can be used for the information that
doesn’t change substantially over months or even years.
 Static pages are easy and simple to understand, secure,
less prone to technology errors and breakdown and
easily visible by search engines.
 HTML was the first tool with which people had begun
to create static web pages.
 Static websites provide flexibility.
 Lightweight .
 Static websites perform faster and well than dynamic
ones.

Write a note on HTTP.

HyperText is the type of text which is specially coded with


the help of some standard coding language called HyperText
Markup Language (HTML)

The protocols that are used to transfer hypertext between


two computers is known as HyperText Transfer Protocol.
HTTP provides standard between a web browser and web
server to establish communication. It is set of rules for
transferring data from one computer to another. Data such
as text, images, and other multimedia files are shared on the
World Wide Web.

Request method

1 GET

The GET method is used to retrieve information from


the given server using a given URI. Requests using GET
should only retrieve data and should have no other
effect on the data.
2 HEAD

Same as GET, but transfers the status line and header


section only.

3 POST

A POST request is used to send data to the server, for


example, customer information, file upload, etc. using
HTML forms.

4 PUT

Replaces all current representations of the target


resource with the uploaded content.

5 DELETE

Removes all current representations of the target


resource given by a URI.

6 CONNECT

Establishes a tunnel to the server identified by a given


URI.

7 OPTIONS

Describes the communication options for the target


resource.

8 TRACE

Performs a message loop-back test along the path to


the target resource.
Message method

 Request-header: These header fields have applicability


only for request messages.
 Response-header: These header fields have
applicability only for response messages

Header Type Contents

User-Agent Request Information about the browser and its platform

Accept Request The type of pages the client can handle

Accept-Encoding Request The page encodings the client can handle

Accept-Language Request The natural languages the client can handle

Content-Encoding Response How the content is encoded (e.g., gzip)

Content-Language Response The natural language used in the page

Expires Response Time and date when the page stops being valid

Location Response Tells the client where to send its request

Date Both Date and time the message was sent

Range Both Identifies a portion of a page

ETag Both Tag for the contents of the page

Upgrade Both The protocol the sender wants to switch to

.Write a note on HTTP caching.

Refer 2m
Benefits of Caching
Summing up, we have listed the main benefits of caching below:

 latency reduction;
 bandwidth consumption reduction;
 network traffic reduction;
 website speed and performance increase.

Types of Caching

The type of cache is defined according to where the content is stored.

 Browser cache - this storage is done in the browser. All browsers have a local storage, which
is usually used to retrieve previously accessed resources. This type of cache is private since
stored resources are not shared.
 Proxy cache - this storage, also called intermediate caching, is done on the proxy server,
between the client and the origin server. This is a type of shared cache as it’s used by multiple
clients and is usually maintained by providers.
 Gateway cache - also called reverse proxy, it’s a separate, independent layer, and this storage
is between the client and the application. It caches the requests made by the client and sends
them to the application and does the same with the responses, sending from the application to
the client. If a resource is requested again, the cache returns the response before reaching the
application. It’s also a shared cache, but by servers not users.
 Application cache - this storage is done in the application. It allows the developer to specify
which files the browser should cache and make them available to users even when they are
offline.

Cache-Control
In the Cache-Control header, the following standard directives can be given for caching:

 private
Content is considered private as only one user has access. In this case, private content can be
stored by the client’s browser but not by intermediate caches.

 public
Content is considered public as more than one user can have access. Content can be stored by
the browser or in other caches between the client and server.

 no-store
Content can’t be cached, so the request is always sent to the origin server. This format is
indicated when transmitting confidential data.

 no-cache
The cached content must be revalidated in each new request, and this makes the content
immediately obsolete. In this case, the cache sends the request to the origin server for
validation before releasing the stored copy.

 max-age
Defines the maximum amount of time content can be cached without being revalidated on the
origin server. The time is defined in seconds and the maximum is one year (31,536,000
seconds).

 s-maxage
Indicates the amount of time content can be cached and is therefore very similar to max-age,
but the difference is that this option only applies to intermediate caches but not the browser.

You might also like