unit 1 lecture notes for computer networks, Lecture notes of Computer Networks

its included all the important topics in unit 1

Typology: Lecture notes

2017/2018

Uploaded on 01/23/2018

arunraja-palaniappan
arunraja-palaniappan 🇮🇳

1 document

1 / 17

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CS6651-Computer Networks 1.1
Vijai Anand
cseannauniv.blogspot.in
Define computer network.
Computer network is a connection of autonomous computers and network devices for:
Resource sharing (data/devices) in an efficient manner
Communication amongst them.
Compare simplex and duplex communication with example.
Simplexcommunication is unidirectional (eg. keyboard, monitor).
Half-duplexCan transmit and receive, but not simultaneously (eg. walkie-talkie)
Full-duplexCan transmit and receive simultaneously (eg. telephone network).
List the criteria based on which a network can be assessed.
Performance is based on its throughput (no. of packets delivered) and delay.
Reliability is how much the network is fault tolerant.
Security includes preventing unauthorized access and recovery from breaches.
What are the two types of line configuration?
A point-to-point connection provides a dedicated link between two nodes.
In a multipoint, more than two nodes share a single link, i.e., bandwidth is shared.
State any two topologies in which a network can be organized.
Mesh
Star
Bus
Ring
Mesh: Each device has a dedicated point-to-point link to every other device. It is robust
and secure. Installation is difficult and expensive n(n-1) link for n node.
Star: Each device has a dedicated point-to-point link to the hub. All communication goes
via the hub. It is less expensive and robust. If hub fails, then the network non-functional.
Bus: It is multi-point and signal gets weak as it travels through the long cable that acts as
backbone. A fault in the bus stops the entire transmission
Ring: Each device has a dedicated point-to-point connection with the devices on either
side of it. A break in the ring can disable the entire network due to unidirectional traffic.
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff

Partial preview of the text

Download unit 1 lecture notes for computer networks and more Lecture notes Computer Networks in PDF only on Docsity!

Define computer network. Computer network is a connection of autonomous computers and network devices for:  Resource sharing (data/devices) in an efficient manner  Communication amongst them. Compare simplex and duplex communication with example.Simplex —communication is unidirectional (eg. keyboard, monitor).  Half - duplex —Can transmit and receive, but not simultaneously (eg. walkie-talkie)  Full - duplex —Can transmit and receive simultaneously (eg. telephone network). List the criteria based on which a network can be assessed.Performance is based on its throughput (no. of packets delivered) and delay.  Reliability is how much the network is fault tolerant.  Security includes preventing unauthorized access and recovery from breaches. What are the two types of line configuration?  A point-to-point connection provides a dedicated link between two nodes.  In a multipoint, more than two nodes share a single link, i.e., bandwidth is shared. State any two topologies in which a network can be organized. Mesh Star Bus RingMesh : Each device has a dedicated point-to-point link to every other device. It is robust and secure. Installation is difficult and expensive n(n-1) link for n node.  Star : Each device has a dedicated point-to-point link to the hub. All communication goes via the hub. It is less expensive and robust. If hub fails, then the network non-functional.  Bus : It is multi-point and signal gets weak as it travels through the long cable that acts as backbone. A fault in the bus stops the entire transmission  Ring : Each device has a dedicated point-to-point connection with the devices on either side of it. A break in the ring can disable the entire network due to unidirectional traffic.

Classify LAN, WAN, MAN, SAN and Internetwork.Local Area Network (LAN) is private network in a single office, building, or campus. LAN size is limited to a few kilometers. The speed of LAN is in range 10 – 1000 Mbps.  Wide Area Network (WAN) provides long-distance transmission of data, image, audio, and video over large geographic areas that may comprise a country / continent.  Metropolitan Area Network (MAN) is a network with size between LAN and WAN. It is designed for high-speed connectivity to Internet, with endpoints spread over a city.  When two or more networks are connected, it is known as internetwork or internet.  Storage area network (SAN) is confined to a single room and used to connect various components of a high-performance computing system to storage servers. List the advantages of layering.  It decomposes the problem of building a network into more manageable components.  It provides a more modular design. To add a new service, then it is only needed to modify the functionality at one layer, reusing the functions at all the other layers.  Uses abstraction to hide complexity of network from application. Define protocol.  Abstract objects that make up the layers of a network system are called protocols.  Each protocol defines two different interfaces. o Service interface that specifies the set of operations o Peer-to-peer interface for messages to be exchanged amongst peers  Protocol is a set of rules that govern communications between devices. What is a protocol graph?  The suite of protocols that make up a network system is represented as a protocol graph.  The nodes correspond to protocols and edges represent a depends-on relation. Discuss the requirements for building a computer network.

1. Perspectives  An application programmer list the services based on application needs. For example, a guarantee that each message will be delivered without error or within a certain time or to allow graceful switching in a mobile environment.  A network operator lists the characteristics of a system that is easy to administer and manage. For example, fault isolation, adding new devices, easy to account for usage, etc.  A network designer lists the properties of a cost-effective design. For example, efficient utilization of network resources, fair allocation to users, etc. 2. Scalable Connectivity  A system that is designed to support growth to an arbitrarily large size is scalable.  Physical medium is referred to as link , and devices that connect to the link are nodes.  End nodes can be connected through a set of forwarding nodes called switches to build networks. Switching could be either circuit or packet switching.  Independent networks are connected to form internetwork or internet. A node that connects two or more networks is known as router.

Define network architecture.  Set of rules governing form and content of protocol graph is called network architecture.  Network architecture guides the design and implementation of computer networks.  Two commonly used architecture are o OSI Architecture o Internet or TCP/IP architecture What purpose do header and trailer serve?  A layer communicates control information to its peer, instructing it how to handle the message when it is received by attaching a header in front of the message.  The trailer usually contains error control information.  A header/trailer is a small data structure consists of a few bytes. Brief the terms unicast, multicast and broadcast.  The different types of addressing are: o unicast (one-to-one communication), o multicasting (communicating to all members of a group) and o broadcast (sending to all nodes on the network). What is encapsulation?  As data passes through a layer, it attaches its header and then passes it to the next layer.  For the next layer, the data and header of the previous layer is encapsulated as a unit.  It then attaches its header and passes to the next layer and so on. Discuss in detail the layers of OSI model with a neat diagram (or) Layering and Protocol.  ISO defines a common way to connect computers, called Open Systems Interconnection (OSI) architecture. (eg. public X.25 network).  OSI partitions network functionality into seven layers namely, Physical, Data Link, Network, Transport, Session, Presentation and Application.  Bottom three layers are implemented on all nodes in the network including switches.

1. Physical Layer  It coordinates the functions required to carry a bit stream over a physical medium.  Encoding —Bits are encoded into signals (electrical or optical) for transmission.  Data rate —Defines the transmission rate (number of bits sent per second).  Physical topology —How devices are connected (mesh, star, ring, bus or hybrid)  Transmission mode —Direction of transmission (simplex or duplex). 2. Data Link Layer  The data link layer transforms a raw transmission facility to a reliable link.  Framing —Bit stream is divided into manageable data units called frames.  Physical addressing —Header contains physical address of sender and receiver  Flow control —If receiving rate is less than the transmission rate, flow control mechanism avoids sender overwhelming the receiver.  Error control —Redundant information is put as trailer to detect corrupt frames.  Access control —Protocol that determines which device has control over the shared link. 3. Network Layer  It is responsible for source-to-destination delivery of a data unit called packet.  Logical addressing —A packet is identified across the network using logical addressing provided by network layer and is used to identify the end systems.  Routing —Routers prepare routing table to send packets to their destination. 4. Transport Layer  Transport layer is responsible for process-to-process delivery of the entire message.  Port addressing —Processes communicates with each other using through ports.  Segmentation and reassembly —A message is divided into transmittable segments , with a sequence number. Segments belonging to a message are reassembled at the other end.  Connection control —Protocols can be either connectionless or connection-oriented. 5. Session Layer  It establishes, maintains, and synchronizes interaction among communicating systems.  Dialog control —Enables two systems to enter into a dialog and communicate  Synchronization —Adds checkpoints to a stream of data, used when system crashes.  Binding —Binds different streams (audio & video stream in videoconference application). 6. Presentation Layer  It is concerned with syntax and semantics of information exchanged between peers.  Translation —Facilitates interoperability when end nodes use different encoding systems.  Encryption —Ensures privacy by encrypting the message before sending.  Compression —Data compression reduces bandwidth requirements (eg. Multimedia).

Briefly explain the socket API for implementing network application.  Network protocols are implemented as part of operating system and interface provided is known as network application programming interface (API).  Network APIs provide syntax through which protocol services are invoked.  Unix socket interface is widely used. Socket is an endpoint on the communication link between applications running on the network.  Operations defined are socket creation, binding socket to network, send / receive messages and finally close the socket. Socket Creation  Socket is created using socket interface. A handle is returned on successful creation. socket ( domain , type , protocol ) o domain argument specifies protocol family (PF_INET for Internet family, PF_PACKET for direct access to network, etc) o type argument specifies stream (SOCK_STREAM for byte stream, SOCK_DGRAM for message-oriented service, SOCK_RAW for raw sockets) o protocol argument specifies the protocol used (default value 0 ). Server Process  Server processes perform passive open, i.e., it waits for client requests by invoking the following operations: bind ( socket , address , addr_len ) listen ( socket , backlog ) accept ( socket , address , addr_len ) o bind operation attaches the socket to server host's IP address and port. Server port number is well-known, i.e., 0–1024 (for example, web servers use port 80). o listen operation specifies number of pending connections. o accept operation blocks until a client establishes connection Client Process  Client processes perform active open, i.e., it establishes connection with the server using connect operation. connect ( socket , address , addr_len )  Client knows the remote server's logical address and port number and lets the system fill in detail such as client IP address and ephemeral port number. Communication  Communication between server and client process takes place after connection establishment using send and recv operation. send ( socket, message, msg_len, flags ) recv ( socket, message, msg_len, flags ) o send operation is used to send message over the socket and recv operation is used to store the message received over the socket onto a buffer.

Discuss the factors that affect performance of the network.

1. Bandwidth and Latency  Bandwidth refers to number of bits that can be transmitted over the network within a certain period of time ( throughput ).  Bandwidth also determines how long it takes to transmit each bit. For example, each bit on a 1-Mbps link is 1μs wide, whereas each bit on a 2-Mbps link is 0.5μs wide.  Latency refers to how long it takes for the message to travel to the other end ( delay ). It is a factor of propagation delay, transmission time and queuing delay Latency = Propagation + Transmit + Queue  Speed of light propagation depnds on medium (vaccum/copper cable/optical fiber) in which it travels and distance. Propagation = Distance / SpeedOfLight  Transmission time depends upon bandwidth and packet size. Transmit = Size / Bandwidth  Queuing delay occurs at switches and routers, since packets are stored before forwarded.  For applications that have minimal data transfer, latency dominates performance, whereas for bulk data transfers, bandwidth dominates performance. 2. Delay × Bandwidth Product  Consider a pipe, in which bandwidth is diameter and delay corresponds to length.  The delay × bandwidth product specifies the number of bits in transit. It corresponds to how much the sender should transmit before the first bit is received at the other end.  For example, for a cross-country fiber with 10 Gbps bandwidth, distance of 4000 km, the RTT is 40 ms and RTT × bandwidth is 400 Mb. 3. High Speed Networks  High speed networks enhances the bandwidth for applications but latency remains fixed.  For example, when a 1 MB file is transmitted over a 1 Mbps link takes 80 RTTs, whereas the same file over a 1 Gbps links falls short of 1 RTT.  Effective end-to-end throughput that can be achieved is given as Throughput = TransferSize / TransferTime  TransferTime includes latency as well as setup time. It is computed as TransferTime = RTT + 1/Bandwidth × TransferSize 4. Application Performance Needs  Applications generally require as much bandwidth provided by the network.  Average bandwidth of flow rates could be estimated, but instantaneous bursty traffic should also be handled.

3. Point-to-Point Protocol (PPP)  PPP is byte-oriented and used to carry IP packets over point-to-point links.  PPP uses sentinel and employs character stuffing.  Flag field contains special character 01111110.  Protocol field is used for multiplexing.  Body (data) is 1500 bytes by default. 4. High-Level Data Link Control (HDLC) Protocol  HDLC is bit-oriented protocol and views frame as a collection of bits. The frame format  Frame beginning and end contains a special bit sequence 01111110 Bit Stuffing  To prevent occurrence of bit pattern 01111110 as part of frame body, bit stuffing is used.  If a 0 and five consecutive 1 bits are encountered, sender adds an extra 0.  This extra stuffed bit is eventually removed from the data by the receiver.  The real flag 01111110 is not stuffed by the sender.  If a bit such as 01111111 arrives, then an error has occurred and the frame is discarded. 5. Synchronous Optical Network (SONET)  SONET standard is clock-based framing of fixed size.  Runs on the carrier's optical network and offers rich set of services.  Lowest speed SONET link STS-1 frame consist of 9 rows with 90 bytes each row.  First 2 bytes of the frame contain a special bit pattern indicating start of frame.  First 3 bytes of each row are overhead and rest containing data.  Bit stuffing is not employed here  Receiver looks for the special bit pattern every 810 bytes. If not, the frame is discarded.

 Overhead bytes of a SONET frame are encoded using NRZ encoding.  SONET supports the multiplexing of multiple low-speed links. The links range from 51.84 Mbps (STS-1) to 2488.32 Mbps (STS-48).  STS-1 frame is 810 bytes long with speed 51.84 Mbps, whereas STS-3 frame is 2430 bytes long at rate 155.52 Mbps.  STS-N signal can being used to multiplex N STS-1 frames. The payload from STS- 1 frames are linked together to form a STS-N payload, denoted as STS-Nc. How errors are introduced in the data?  Bit errors are introduced into frames because of electrical interference or thermal noise.  This interference can change the shape of the signal, i.e. bit inversion. List the types of error with an example.  The two types of error are single-bit error and burst error  Single-bit error means that only 1 bit of a given data unit is changed. Single-bit errors are the least likely type of error in serial data transmission.  Burst error means that 2 or more bits in the data unit have changed  The length of the burst is measured from the first corrupted bit to the last corrupted bit. Differentiate error detection and error correction.  Error detection—Receiver uses redundant information to detect whether the received data contains error or not. If an error is detected, the data is discarded and sender retransmits. Methods are Two dimensional parity, Internet checksum, CRC  Error correction—Receiver uses the redundant bits to determine which bits are corrupted and original data is restored by the receiver. No retransmission is required. Methods are Hamming code, Reed Solomon, etc. Explain error detection methods in detail with example  Error detection is only to see if data is corrupted or not. A single-bit or burst error is immaterial.  Sender adds k redundant bits for n data bits ( k << n ) to a frame, which is used by the receiver to determine if errors are there or not.

3. Cyclic Redundancy Check (CRC)  CRC uses the concept of finite fields.  A n bit message is represented as a polynomial of degree n - 1.  Message M( x ) is represented as a polynomial by using the value of each bit as coefficient for each term. For example, 10011001 is represented as x 7 + x 4 + x 3 + 1  For calculating a CRC, sender and receiver agree on a divisor polynomial, C ( x ) of degree k such that kn – 1 Sender  Multiply M( x ) by x k i.e., append k zeroes. Let the modified polynomial be M'( x )  Divide M'( x ) by C( x ) using XOR operation. The remainder has k bits  Subtract the remainder from M'( x ) using XOR, say T( x ) and transmit T( x ) with n + k bits. Sender Receiver Receiver  Divide the received polynomial T'( x ) by C( x ) as done in sender  If the remainder is non-zero then discard the frame  If zero, then no errors and redundant bits are removed to obtain data Divisor Polynomial  Divisor polynomial C( x ) should has the following error-detecting properties: o All single-bit errors, as long as the xk^ and x^0 terms have nonzero coefficients. o Any “burst” error for which the length of the burst is less than k bits. o Any odd number of errors, as long as C( x ) contains the factor ( x + 1)  It is implemented in hardware using a k - bit shift register and XOR gates.  Widely used in networks such as LANs and WANs.  Different versions of CRC are CRC-8, CRC-10, CRC-12, CRC-16, and CRC-32.

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

1. Stop and Wait ARQ  Sender keeps a copy of the frame and then transmits it.  Waits for an acknowledgment before transmitting the next frame.  If acknowledgment does not arrive before timeout, the sender retransmits the frame. (a) (b) (c) (d) Scenarios a) ACK is received before the timer expires. The sender sends the next frame. b) The frame gets lost in transmission. Sender eventually times out and retransmits frame. c) ACK frame gets lost. The sender eventually times out and retransmits the frame. d) The sender times out soon before ACK arrives and retransmits the frame. Sequence number

 A frame numbered SeqNum is accepted if LFR < SeqNum ≤ LAF, otherwise discarded.  Frames that arrive out of order is buffered but not acknowledged.  If all preceding frames up to SeqNumToAck has arrived, then receiver acknowledges frame SeqNumToAck. The acknowledgement is cumulative. Variables updated are: o LFR = SeqNumToAck o LAF = LFR + RWS

. Sequence Number  Sequence numbers are modulo 2m^ where m is the size of sequence field and wrap around.  To avoid the issue of identifying sequence numbers of different sets, SWS is defined as SWS < (MaxSeqNum + 1) / 2 Example Briefly discuss the two variants of sliding window protocol.  The two variants of sliding window protocol are Selective Repeat and Go Back N. 1. Selective Repeat  Size of RWS is same as SWS.  When frames are lost or corrupt, there is less data in transit, since the sender cannot advance its window without an acknowledgement.  When an out-of-order frame arrives, receiver sends a negative acknowledgement (NAK) forcing the sender to retransmit the expected frame. This is known as Selective Repeat.  NAK speeds up retransmission of a frame before timer expires and improves performance 2. Go-Back-N  In Go-Back-N sliding window protocol, the size of receiver window is 1.  The receiver accepts only the expected frame and discards any other frame that arrives.  Sender eventually timeout and retransmits all outstanding frames.  Not suited for noisy channels.

List the advantages of sliding window flow control.  It delivers frames reliably across an unreliable link using timeout and acknowledgement.  It preserves the order in which frames are transmitted. The receiver ensures that it does not pass a frame to the upper layer until all lower numbered frames are passed.  It supports flow control. The receiver through acknowledgement informs the sender about how many frames it can still receive. Distinguish between Stop & Wait and Sliding window protocol.  Only one frame could be outstanding in Stop-and-Wait, whereas multiple frames can be outstanding in sliding window, i.e., improved efficiency.  Stop-and-Wait ARQ protocol is a special case of sliding window in which the sender window size is 1.  Frames are numbered as modulo- 2 m in sliding window whereas it is sequenced as modulo-2 in stop and wait protocol. List the design issues of data link layerFraming —Breaking the bit stream into frames with well-defined frame boundary  Error Control —Involves error detection and correction methods using redundant information to verify integrity of the data.  Flow Control —Mechanisms that prevents fast sender from swamping a slow receiver with frames  Access Control —Resolve conflicts and collisions that arise when multiple nodes compete to transmit data over a shared link. What is concurrent logical channel?  When more than one logical channel is multiplexed onto a single point-to-point link is known as concurrent logical channel.  Stop and wait is run on each of these logical channels.  When a node has frame to send, it is sent on the lowest idle channel.