Computer Networks Notes PDF
Document Details
Uploaded by AdvancedThunderstorm8220
Tags
Summary
These notes detail fundamental concepts of computer networks. It covers various network models, protocols, and technologies. The notes also explain different types of network topologies and their functionalities.
Full Transcript
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 mediu...
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 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. Encapsulating Security Payload EH is similar in format and use to the IPv4 ESP header defined in RFC2406. 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 (S