Sie sind auf Seite 1von 89

What is the use of sharing computers over the network?

Ans: Sharing computers over the network enable you to exchange information and resources amongcomputers and their users. Information exchange can be electronic mail or file transfer.Resource sharing can be usage of peripheral device, such as printer, connected to other computers. 2. What is a workgroup? Ans: A group of users who share information in a multi-user environment is known as a workgroup. 3. What is the WWW? Who invented it? Ans: World Wide Web or the WWW is a bank of information that is available over the network. TimBerners-Lee invented it in 1989 4. What is a Web browser? Ans: Web browser is a software for viewing websites. Internet Explorer and Netscape Navigator aresome popular Web browsers. 5. What is a modem? Ans: A modem (MOdulate DEmodulate) is a device used to connect to the Internet throughtelephone lines The following section provides some extra inputs on the important topics covered in the SG: Types of Network The most common types of network are as follows: Local Area Network (LAN) : LAN consists of a group of computers and associated devices,such as printers, modem, fax machine, and scanners. It provides networking capability to agroup of computers that are located within a single physical location such as a building. Youcan connect LAN to MAN and

WAN using routers. The data transmission speeds normallyranges from 1 to 100 megabits per second. Metropolitan Area Network (MAN) : MAN connects computers over a large geographicalarea, such as a city or a state. The size of MAN is intermediate between LAN and WAN. Inaddition, the data transmission speeds ranges between the speeds of LAN and WAN. Wide Area Network (WAN) : WAN can spread over a large physical distance, such as theInternet that spans across countries. You can use routers to connect a LAN to WAN.Normally, the transmission rates are 2 Mbps, 34 Mbps, 45 Mbps, 155 Mbps, 625 Mbps.Organizations that support WAN and use the Internet Protocol are called NSP (NetworkService Providers). NSP forms the core of the Internet. Network Configurations The network configurations can be categorized as follows: Peer-to-peer network : You can design a peer-to-peer network if you have a small network,which does not require security. A peer-to- peer network is also called as a workgroup. In apeer-to-peer network, the computers communicate with each other directly. This networktype does not have a server, which manages the resources on the network. A single devicesu ch a s a h u b c a n ce n tra lly c o n n e c t a n d c o n tro l a ll th e n o d e s o n the n e two rk . Ea c h computer on the network can share files and peripherals that are connected to the network.Peer-to-peer network is a low-cost solution. However, if you have to share large andcomplex files, such as databases or graphics, then the peer-to-peer network is not anefficient solution. In this situation, client-server network will be efficient. Client-server network : If your network requirements include more than ten nodes, andwork with large files such as databases, then you need to design a client-server network.The computers in a client-server network are connected to a server. The server enables

i d N

N n e C e

I a o t

I t m w

T o p o

C r u r

o G t k

o u e s

r i r

you to manage data, share information, and secure the network. You can set up a client-server network to support more than thousand user accounts, which are managed byadministrators. To set up a

client-server network, you need more resources than a peer-to-peer network. Components of Network Infrastructure The components of a network infrastructure are as follows: Intranet : Intranet can be a corporate LAN or MAN. A private network enables distribution of information within an organization. LAN offers services such as access to databases andsoftware distribution. In addition to file and printing services, the intranet uses applicationsth a t a re a sso c ia te d with th e In te rn e t su c h a s, We b B ro wse rs, We b p a g e s, F TP (F ile Transfer Protocols) sites, and mailing lists that can be accessed only by the users in theo rg a n iz a tio n . In tra n e ts a re s e t u p to p ro vid e q u ic k a c c e s s to e mp lo ye e s with in a n organization.The basic protocol that is used for connectivity in intranet is TCP/IP. It is a set of networkingprotocols that are based on industry standards. The scalability of the protocol includes allsizes of networks. Extranet : Extranet refers to an intranet that is partially accessible to authorized users outsid e a n o rg an iz a tio n . A c o lla b o ra tive n e two rk u se s In te rn e t Pro to c o l a n d th e p u b lic telecommunication systems to securely access resources from the organization. It uses Internet technology to connect the business of an organization to suppliers, customers, or other business organizations.An extranet can be accessed only if you have a username and a password. Permissionsare used to set various levels of accessibility for the outsiders. By doing so, you can providelimited access to information on your intranet. Internet : Internet is a public and global communication network that can be used to accessa Web site, upload files in the FTP, or use an e-mail message. You can connect to Internetusing the following two methods:

Dial-up connection can be used to connect to an ISP. Small organizations or Internetusers at home normally use this method. A dedicated line such as T1 can be used to connect to LAN. LAN can be configured toconnect to Internet. This method is used in large organizations that have their own nodeon the Internet or connect to an ISP The following section provides some extra inputs on the important topics covered in the SG: TCP/IP TCP/IP is a connection-based protocol that provides a reliable flow of data between twocomputers. It is a suite of protocols and is based on industry standards. TCP/IP is a routableprotocol capable of switching packets of data between subnets by using the address of thedestination that is contained in the packet. Features of TCP/IP The features of TCP/IP are as follows: TCP/IP supports large window support. If large number of data packets is broadcasted andthe session is lengthy, then the size of the window is dynamically changed. This increasesthe bandwidth and enables more data packets to be broadcasted in the network at one time. A TC P/ IP h o st c a n n o tify a n d re q u e st th e se n de r if a n y d a ta p a c k e ts a re mis sin g o r corrupted during the broadcast. This enables the sender to send only the corrupted or missing data packets to the receiver again. The time taken for a round-trip communication between the sender and receiver is calledRTT (Round Trip Time). Estimating RTT enables you to estimate the packet transit timesand adjust for optimum retransmission time for packets. Advantages of TCP/IP The advantages offered by TCP/IP are as follows: I t c o n n e c ts d isp a ra te h o sts. I n a d d itio n , TC P/ IP is a ro u ta b l e p ro to c o l, wh i c h c a n b econnected to different networks by using gateways.

It provides a reliable, robust, and scalable cross-platform client-server framework. It can establish a virtual private network (VPN) or extranet with Internet for providing remoteaccess. N I I T C o o r d i n a t o r G u i d e C o m p u t e r N e t w o r k s 5

Utilities of TCP/IP The utilities of TCP/IP are as follows: Data transfer utilities : TCP/IP provides support for data transfer protocols such as, FTP(File Transfer Protocol), HTTP (Hypertext Transfer Protocol), and CIFS (Common InternetFile System). Printing utilities

: Printing can be done directly to IP-based printers. Diagnostic utilities : TCP/IP utilities such as, ipconfig, ping, and Nslookup can be used for diagnosing TPC/IP related problems. TCP/IP Protocol Architecture The four layers of the TCP/IP protocol architecture are as follows: Network Interface Layer : This layer encompasses the data link layer and physical layer of the OSI model. This layer is responsible for placing TCP/IP packets in the network and for sending TCP/IP packets. This layer includes LAN technologies such as Ethernet, andToken Ring and WAN technologies such as Frame Relay. Network Layer : This layer encompasses the network layer of the OSI model. The Internetlayer performs addressing, packaging, and routing. The five protocols that are implementedin this layer are: Internet Protocol (IP) : The IP protocol routes the data packets from the source to thedestination. Address Resolution Protocol (ARP) : The ARP protocol determines the hardwareaddress of the hosts. Reverse Address Resolution Protocol (RARP) : The RARP protocol determines theIP address of disk-less host systems. Internet Control Message Protocol Resolution (ICMP) : The ICMP protocol sendserror messages if there is any TCP/IP related problems. Internet Group Management Protocol (IGMP) : The IGMP protocol sends informationto the routers regarding the availability of the multicast groups.

Transport Layer : This layer encompasses the transport layer of the OSI model. TCPprovides connection-oriented reliable communications for applications that typically transfer large amounts of data at one time. This is very useful if an acknowledgement for datare c e ive d is re q u ire d . Th e p ro to c o ls o f th e tra n sp o rt la ye r a re TC P a n d UD P ( Use r Datagram Protocol). TCP provides a connection-oriented service whereas UDP provides aconnectionless service. Application Layer : This layer encompasses the application layer, presentation layer, andsession layer of the OSI model. This layer is the top most layer in the TCP/IP model. Mostof the TCP/IP utilities such as HTTP, FTP and Telnet run at the Application level. Chapter Two QuestionsPart 11. OSI is a protocol model standardized by the ___________ Ans. ISO 2. OSI has ________ layers. Ans. Seven 3. The ________ layer is responsible for delivering data frames from one station to next withouterror. Ans. Data Link 4. The __________ layer uses the services provided by the network layer. Ans. Transport 5. At the receiving end, the data is passed to transport layer from ________. Ans.

Network 6. Each layer adds ________ to the data it received from the upper layer. Ans. Its own information 7. TCP/IP has ___________ layers. Ans. Five 8. The layers not present in TCP/IP model are __________ and ___________. Ans. Session and Presentation 9. At transport layer the protocols defined by TCP/IP model are _________ and _________. Ans. UDP and TCP 10. RFC stands for ______________. Ans. Request for Comments Part 21. Briefly explain what is meant by protocol and protocol architecture. Ans. A protocol is software that resides either in a computer's memory or in the memory of atransmission device, such as a network interface card. Protocols govern format, timing,sequencing, and error control. A protocol is used for communication between entities indifferent systems. For two entities to communicate successfully, they must speak the samelanguage. What is communicated, how it is communicated, and when it is communicated mustconform to some mutually acceptable convention or protocol between the entities involved. Thefollowing are the key elements of a protocol: N I I T C o o r d i n a t o r G u i d e

C e

o t

m w

p o

u r

t k

e s

r 7

Syntax : Includes such things as data format and signal levels Semantics : Includes control information for coordination and error handling Timing : Includes speed matching and sequencingProtocol architecture is a structured set of modules that implements the communication functionbetween computers. 2. Briefly explain the OSI architecture. Ans. Open System Interconnection (OSI) protocol architecture, defined by the International Standards Organization (ISO), includes a set of protocols to define and standardize the datacommunication process. It defines how data communications take place in the real world andwhat protocols should be used at each layer.The following are the salient features of OSI protocol architecture: Layered architecture : The OSI model is composed of seven ordered layers: Physical(layer 1), Data link (layer 2), Network (layer 3), Transport (layer 4), Session (layer 5),Presentation (layer 6), and Application (layer 7). Within a single computer system, each layer calls upon the services of the layer just below it. For example, Network layer (layer 3)uses the services provided by the Data link layer (layer 2) and it provides services toTransport layer (Layer 4). Peer-to-peer process

: The processes on each system that communicate at a given layer are called peer-to-peer processes. Communication between machines is therefore a peer-to-peer processes communicating to each other using protocols appropriate to the givenla ye r. A t th e p h ysic a l la ye r, c o mmu n ic a tio n is d ire c t. H o we ve r, a t th e h ig h e r la ye rs, communication must move down through the layers on Device A, over to the device B, andthen back up through the layers. Each layer in the sending device adds its own informationto the message it receives from the layer just above it and passes the whole package to thelayer just below it. Headers are added to the data at layers 6,5,4,3 and 2. Trailers are usually added only at layers 2. Layer organization : The seven layers can be thought of as belonging to three subgroups.The layers 1, 2, and 3, called the Physical, Data Link, and Network layers respectively, arethe network support layers. They deal with the physical aspects of moving data from onedevice to another device. The layers 5, 6, and 7, called Session, Presentation, Applicationrespectively, are the user support layers. They allow i nteroperability among unrelatedsoftware systems. The layer 4 called the Transport layer links the two subgroups and ensures that the upper layers can use the data that the lower layers have transmitted. Theupper OSI layers are implemented in software. The lower OSI layers are a combination of hardware and software, except for the physical layer, which is mostly hardware. 3. What are the functions of the network layer? Explain. Ans. The network layer is responsible for the source-to-destination delivery of a packet possiblyacross multiple networks (links). Whereas data link layer oversees the delivery of the packetbetween two systems on the same network (link), the network layer ensures that each packetgets from point of origin to its final destination. If the two systems are connected to the samelink then there would be no requirement for the network layer. However if the two systems areattached to different networks with connecting devices (known as routers) between thenetworks, then this layer plays a crucial role in getting the

packet from source to destination.The Network layer provides for the transfer of data in the form of packets across thecommunication networks. It establishes, maintains, and terminates logical and physicalconnections across multiple interconnected networks. A key aspect of this transfer is the routingof packets from the source to the destination machine typically traversing a number of transmission links and network nodes where routing is carried out. Routing is the process bywhich a path is selected out of many available paths to the destination so that data packet reaches the destination fast, efficiently, reliably as required. This function makes the networkmost complex layer in the reference model Explain the functionalities and the services offered by the transport layer of the OSI model. Ans. The transport layer is designed to provide the transparent transfer of data from a source endopen system to a destination end open system," according to the OSI Reference Model. Thetransport layer establishes, maintains, and terminates communications links between twomachines.The Transport layer ensures data is successfully sent and received between two end systems.If data is sent incorrectly, this layer has the responsibility to ask for retransmission of the data.Also it ensures data are passed onto the upper layers in the same order in which they weresent. Specifically, it provides a reliable, network-independent message-interchange service tothe top three application-oriented layers. This layer acts as an interface between the bottomand top three layers. By providing the session layer with a reliable message transfer service, ithides the detailed operation of the underlying network from the session layer.Some of the important services that are performed by the transport layer in order to meet theabove requirements are: Service-point addressing : Computers often run several programs at the same time. For this reason, source-to-destination delivery means delivery not only from one computer tothe next but also from a specific process (a running program) to a specific process at thereceiving end. The transport layer

header must therefore include a type of address calledservice-point address (or port address). The network layer gets each packet to the correctcomputer; the transport layer gets the entire message to the correct process on thatcomputer. Segmentation and reassembly : If the message sent by the application program at thetransmitting end is huge, there would be problem in moving that from the transmittingsystem to the receiving system as many of the physical network underneath would imposerestriction on the maximum size of the data that can be transferred at one time. In order toover-come this restriction, transport layer splits the incoming message into segments (eachof transferable size) at the transmitting system and reassembles them at the receiving end.Apart from the above, other tasks performed by the transport layer are Connection control, Flowcontrol, and Error control. 5. What are the functionalities of the session layer of OSI model? Ans. The session layer organizes and synchronizes the exchange of data between applicationprocesses. It works with the application layer to provide simple data sets called synchronizationpoints that let an application know how the transmission and reception of data are progressing.In simplified terms, the session layer can be thought of as a timing and flow control layer.The session layer is the network dialog controller. It establishes, maintains, and synchronizesthe interaction between communicating systems. Specifically its responsibilities include: Dialog control : This allows two systems to enter into a dialog. It allows the communicationbetween two processes to take place either in halfduplex (one way at a time) or full duplex(both ways simultaneously). Synchronization : The session layer allows a process to add checkpoints (synchronizationpoints) into a stream of data. For example, if a system is sending a file of 2,000 pages, it isadvisable to insert checkpoints after every 100 pages to ensure that each 100 page is received

and acknowledged independently. The reception of acknowledgement for thesecheckpoints ensures to the sending system that data up to the corresponding checkpoint isreceived properly by the receiving end system.An example where session layer plays a crucial role is the file transfer application when used totransfer huge files (downloading of huge files). When huge files are transferred across thenetwork, if the network connection speed is not high, it would take very long time for transfer.There is every chance that network connection would break during this transfer and the user isrequired to start a fresh to do the file transfer, and there is no guarantee that the same would N I I T C o o r d i n a t o r G u i d e C o m p u t e r N e t w o r k s 1 0

not repeat, making it sometime practically impossible to download very huge files. If thecheckpoints are used by the file transfer application then, this problem can be sorted out easily.Suppose the connection fails during the 1034th page, then after reconnecting we can proceedfrom the last checkpoint, i.e. from page 1001. During retransmission time the only pages thatare resent for the second time are 1001 to 1034 as pages till 1000 are received andacknowledged. If checkpoints were not there, we have to start from page 1 every time we try toreconnect. 6. What are the layers present in TCP/IP model? Explain the layer, which provides the transportfunctionalities along with the protocols defined for that layer. Ans. The TCP/IP model is made up of five layers: Physical layer Data Link layer

Network layer (IP) Transport layer (UDP and TCP) Application layer The layer that provides the transport functionalities along with the protocols defined for thatlayer is Network layer. The network layer is concerned with access to and routing data across anetwork for two end systems attached to multiple interconnected networks. The InternetProtocol (IP) is used at this layer to provide the routing function across multiple networks. Thisprotocol is implemented not only in the end systems but also in routers. A router is a processor that connects two or more networks and whose primary function is to relay data from onenetwork to the other on its route from the source to the destination end system.The Internet Protocol (IP) is the transmission mechanism used by the TCP/IP protocols. It is anunreliable and connectionless datagram protocol i.e. it provides a best-effort delivery service.The term best-effort means that IP provides no error checking or tracking. IP assumes theunreliability of the underlying layers and does its best to get the get a transmission through to itsdestination, but with no guarantees. IP transports data in packets called datagrams each of which is transported separately. Datagram can travel through different routes and can arrive outof sequence or be duplicated. IP does not keep track of routes and has no facility to reorganizedatagrams once they arrive at their destination. These limitations should not be considered asthe weakness of the protocol stack. It is intentional, to get the maximum efficiency. The purposeat this layer is to provide the bare-bone transmission functions that free the user to add onlythose facilities necessary for a given application.At this network layer TCP/IP supports the Internetworking Protocol (IP) . IP, in turn, contains four supporting protocols: ARP, RARP, ICMP and IGMP. 7. Make a brief comparison between OSI and TCP/IP models. Ans. The OSI architecture is a de-jure (according to law) standard. The focus in the OSI world hasalways been more on the standard than the implementation of the standard. The OSI model isused as a reference model

to make comparisons. The OSI reference model was devised beforethe protocols were implemented. The ordering means that the model was not biased towardone particular set of protocols, which made it quite general.The TCP/IP architecture is a de-facto (in reality) standard. With the TCP/IP model, the protocolscame first, and the model was just a description of the existing protocols. The TCP/IP model isnot used to describe other models . What is the difference between network protocol and protocol architecture? Ans: A network protocol is a set of rules for communication between computers. Protocolarchitecture is a structured set of modules that implements the communication functionbetween computers. 2. What does OSI stands for? Ans: OSI stands for Open System Interconnection. 3. What is OSI protocol architecture? Ans: OSI protocol architecture, defined by the International Standards Organization (ISO), includes aset of rules that are used to define and standardize the data communication process. OSIprotocol architecture defines how data communications take place in the real world and whatprotocols should be used at each layer. 4. How many layers are present in the OSI protocol architecture? Ans: The OSI model is composed of seven ordered layers: Physical (layer 1), Data link (layer 2),Network (layer 3), Transport (layer 4), Session (layer 5), Presentation (layer 6), and Application(layer 7). 5. What is TCP/IP protocol architecture? How many layers are present in the TCP/IP protocolarchitecture?

Ans: TCP/IP is the most widely used architecture and is a result of protocol research anddevelopment work conducted on the experimental network, ARPANET. The TCP/IP model ismade up of five layers: Physical layer, Data link layer, Network layer, Transport layer, andApplication layer. The first four layers provide physical standards, network interface,internetworking and transport functions that correspond to the first four layers of the OSI model.However, the three top layers of the OSI model are represented in the TCP/IP by a single layer called Application layer. 6. Explain the data flow from device A to device B through different OSI layers. Ans: The sequence of data transfer from device A to device B through different OSI layers is:Application layer of device A Presentation layer of device A Session layer of deviceA Transport layer of device A Network layer of device A Data link layer of device A Physical layer of device A Physical layer of device B Data link layer of device B Network layer of device B Transport layer of device B Session layer of device B

Presentation layer of device B Application layer of device B The preceding concept is displayed in the following figure: Data Flow from Device A to Device B through Different OSI Layers 7. What is the difference between physical layer and data link layer? Ans: The physical layer is the lowest layer of the OSI model and deals with the "mechanical,electrical, functional, and procedural means" required for transmission of data. The physicallayer is responsible for data transmission from one host to another. The data link layer providesfor the control of the physical layer, and detects and corrects errors that can occur duringtransmission. The data link layer adds header and trailer at the transmitting end and removesthe same at the receiving end. 8. Which layer is responsible for encoding, encrypting, and compressing data? Ans: The presentation layer is responsible for encoding, encrypting, and compressing data 9. What is the difference between OSI model and TCP/IP model? Ans: The OSI model is a de-jure (according to law) standard. The focus in the OSI world has alwaysbeen more on the standard than the implementation of the standard. The OSI model is used asa reference model to make comparisons. The OSI reference model was devised before theprotocols were implemented. The ordering means that the model was not biased toward oneparticular set of protocols, which made it quite general. The TCP/IP model is a de-facto (inreality) standard. With the TCP/IP model, the protocols came first, and the model was just adescription of the existing protocols. The TCP/IP model is not used to describe other models. 10. What is the use of the session layer? Ans:

The session layer organizes and synchronizes the exchange of data between applicationprocesses. It works with the application layer to provide simple data sets called synchronization points that let an application know how the transmission and reception of data are progressing.In simplified terms, the session layer can be thought of as a timing and flow control layer The following section provides some extra inputs on the important topics covered in the SG: IP Addressing A TCP/IP host is identified by a logical and unique IP address. It identifies the physical locationof the host in the network and is similar to a street address that identifies a house on a cityblock.The IP address consists of two parts, netid and hostid: Netid : The netid is also called network address. The netid identifies all hosts that arelocated on the same physical network. All the hosts of one physical network are assignedthe same netid to facilitate communication among them. The netid must be unique in theinternetwork. Hostid : The hostid is also called host address. The hostid identifies a host in the network. Ahostid is unique for every computer in the netid. Note You cannot assign 127 as a netid in the network. This ID isreserved for loopback and diagnostic functions. In addition, you cannot have netid and hostid as 255. This ID is reserved for IP broadcast functions. The IP address is a 32-bit number that uniquely identifies a host such as computer, printer, androuter. The IP address is expressed in a dotteddecimal format and the IP address consists of four octets. Each octet is separated by a dot . 191.168.3.24 is an example of IP address Each octet can be converted to decimal system using a base 10 numbering system. Thefollowing table lists the IP address in binary and dotted decimal format:

B i n a r y F o r m a t D o t t e d D e c i m a l F o r m a t 10101011 10101000 0000001100011000 191.168.3.24 A bit that is set to one can be converted to a decimal value. The following graphic illustrates theconversion of the number 191 to binary digits: Binary Octet of 191=1011111 The conversion of binary digits to a decimal number is illustrated in the following figure: Conversion of Binary Digit to a Decimal Number Note You cannot have all bits within the netid set to 0. All 0s in thenetid are used to denote a specific host on the local network.The data from these hosts will not be routed. Subnets In a physical network, all the hosts that are bounded by IP routers share the same IP traffic.This is because all the hosts are a part of a single domain. It is not possible to have millions of hosts in a single broadcast domain. You can divide the network to smaller domains calledsubnets. This process is called subnetting. Each subnet has a unique subnetted netid. Usingbits from the hostid portion of the original class-based netid create the subnetted ID.However, if you use more bits than needed, then you can have more subnets and few hosts. If you use fewer bits than needed, then you can have less subnets and more hosts Consider an example. You are using Class B IP addresses in your network. Routers connectthe different parts of the network. Class B can have up to 65,536 hosts. The network becomessaturated with IP traffic if you have numerous hosts on the network. The following figuredisplays the Class B network connected to the internetwork through a router: Router Connecting the Class B Network to the Internetwork The class B network of 124.105.0.0 can be subnetted by utilizing the first eight host bits for thenew subnetted netid. When you subnet the 124.105.0.0, you create separate network segmentscalled subnets. You specify unique subnet IDs for these subnets. The router present on thenetwork identifies the subnet ID. Therefore, it can route IP traffic to the appropriate subnetinstead of forwarding the IP traffic to the

whole network. The following figure displays subnets of Class B network connected to the internetwork through a router: Router Connecting the Subnets of Class B Network to the Internetwork Subnet Mask A subnet mask is a 32-bit address that is used for distinguishing the netid from a hostid in the IPaddress. In addition, it is used for specifying if the IP address of a host is located in a localnetwork or in a remote network. Note A default subnet mask is specified for TCP/IP networks that donot have subnets. Although there is a single network, all TCP/IP hosts require a subnet mask. The default subnet mask dependson the type of class IP addresses used on the network. The following table lists the bits used for subnet mask and the dotted decimal notation for each ANDing Process ANDing is a process that is used by TCP/IP to determine if the destination of the data packet isto a local network or a remote network. Before a data packet is sent to the destination, the IPaddress of the destination is ANDed with the subnet mask. If the results match, then IP routesthe packets to the appropriate host. If the results do not match, then the packet is routed to theIP router.To perform the ANDing process, TCP/IP compares each bit in the IP address of the destinationhost to the corresponding bit in the subnet mask. If both the bits are set to one, then theresulting bit is one. In other cases, the resulting bit is zero. The following table lists the resultingbit after combining two binary bits: C o m b i n i n g t h e b i t s R e s u l t i n g B i t 1 A N D 1 1 1 A N D 0 0 0 A N D 1 0 0 A N D 0 0

Consider an example. The network of your organization consists of two subnets, Subnet A andSubnet B. The TCP/IP host in Subnet A needs to send a packet to another TCP/IP host inSubnet A. When TCP/IP is initialized, the IP address of the destination is ANDed with thesubnet mask. Since the subnet mask of the destination is same as that of the source, theresulting bit is one. Therefore, TCP/IP determines that the packet is destined for the localnetwork, Subnet A. Defining a Subnet Mask Consider an example. You have Class B IP addresses in your network. The netid that you haveto use is 172.10.0.0. You are required to divide the network into subnets for reducing thenetwork congestion. You decide to divide the network into five subnets.To define the subnet mask for each subnet, you need to perform the following steps:1 . C o u n t t h e n u m b e r o f b i t s t h a t a r e r e q u i r e d f o r r e p r e s e n t i n g t h e n u m b e r o f p h y s i c a l segments in binary format. You have five subnets on the network. To represent five in binary, you require three bits. Therefore, the binary value is 011.2.In this scenario, you require three bits. Therefore, you configure the first three bits of thehostid as subnet ID. This would mean that the values for first three bits of the third octetwould be one, as shown in the figure above. The decimal value for 11100000 is 224.Therefore, the subnet mask for the above-specified bits is 255.255.224.0. Defining Subnet IDs Consider the subnet mask 255.255.224.0. The binary value for this subnet mask is 1111111111111111 11100000 00000000. The bits that were used for defining the subnet mask are thefirst three bits of the third octet. By varying the values of these three bits, you can have thefollowing list of combinations: 00000000=0 N I i n a e C o N e t 8

I t m w

T o p o

C r u r

o G t k

o u e s

r i r

d d

00100000=32 01000000=64 01100000=96 10000000=128 10100000=160 11000000=192 11100000=224The bits that use all 0s or all 1s cannot be used. This is because all 0s are invalid IP addressesand with all 1s are subnet IDs. All 0s indicate this network only and all 1s match the subnetmask. Now, convert the bits to decimal for each subnet. You can use this value to define therange of hostids for a subnet. The following list displays some of the ranges of IP addresseesthat you can have using the 255.255.224.0 as the subnet mask: 172.10.32.1 to 172.10.63.254 172.10.64.1 to 172.10.95.254 Defining Hostids The first three bits in the third octet of the hostid are used for defining the subnet. Therefore,you can calculate the range of hostids by changing the rest five bits to 11111. The decimalvalue of 00111111 is 32.The third octet in the subnet mask indicates the starting value in the range of the values in thethird octet of the IP address. The ending value in range of IP address is one less than thestarting value.The following table displays the range of hostids possible in a Class B network: Bit values of thethird octet in theSubnet Mask Decimal valueStarting range valueEnding rangevalue 0 0 1 0 0 0 0 0 3 2 x . y . 3 2 . 1 x . y . 6 3 . 2 5 4 0 1 0 0 0 0 0 0 6 4 x . y . 6 4 . 1 x . y . 9 5 . 2 5 4 0 1 1 0 0 0 0 0 9 6

x . y . 9 6 . 1 x . y . 1 2 7 . 2 5 4 1 0 0 0 0 0 0 0 1 2 8 x . y . 1 2 8 . 1 x . y . 1 5 9 . 2 5 4 1 0 1 0 0 0 0 0 1 6 0 x . y . 1 6 0 . 1 x . y . 1 9 1 . 2 5 4 1 1 0 0 0 0 0 0 1 9 2 x . y . 1 9 2 . 1 x . y . 2 2 3 . 2 5 4 For a Class B Network, that uses 14 bits for the hostid, you can have 16,384 hosts on thenetwork. The decimal value of 11111111111111 (14 bits that are used for host ID) is 16,384. Supernetting Supernetting enables you to have multiple IP networks on the same network interface. This is incontrast with subnetting in which you have a single IP network on multiple network interfaces. If the IP addresses are contiguous, then you can use a supernet In subnetting, you borrow bits from the hostid and give it to the netid. The following figureillustrates the netid borrowing a bit from the hostid: Netid Borrowing A Bit from Hostid In supernetting, you borrow bits from the netid and give it to the hostid. The following figureillustrates the hostid borrowing a bit from the netid: Hostid Borrowing A Bit from Netid To create a supernet by combining two Class C networks, you need to have the third octet inthe first IP address divisible by two. For example, the networks 198.41.17.0 and 198.41.18.0cannot be combined into a supernet. However, the networks 198.31.16.0 and 198.31.17.0 canbe combined into a supernet. Chapter Three Questions1. What is an IP address? Ans. Each system on the Internet is recognized by a unique IP address. It is a 32 bit (4 bytes) longnumber. It uniquely identifies the host that is connected to the Internet. The Internet Authoritygrants these addresses. If the local network is not connected to the Internet then it is possible tohave IP address of ones choice. However, there is a subset of addresses available for thatpurpose and it is recommended

to use those addresses only. It is possible for a host to havemultiple IP addresses.An IP address has two parts. The one that identifies the network is known as netid. The other one that identifies the host is known as hostid. 2. What are the different classes of IP addresses available in IPV4? Ans. There are five different IP classes: A, B, C, D, and E. these are designed to cover the needs of different types of organization. Class AIf the first bit is 0, then the given address is a class A address. Remaining portion of the firstbyte define the netid. Byte 2 to 4 determines the hostid. Class A addresses are designed for organizations that are having huge number of hosts connected to their network. Class BIf the first two bits of the IP address are 10, then the given address is a Class B address.Here hostid is 16 bits long and the rest 14 bits are for the netid. These addresses aredesigned for midsize organizations. Class CIf the first three bits of the IP address are 110,then the given address is a Class C address.The next 21 bits define the netid and the remaining 8 bits determine the hostid. These areaddresses are designed for small organizations. N I I T C o o r d i n a t o r G u i d e C o m p u t e r N e t w o r k s 2 0

Class DThis address is meant for multicasting. This does not have netid or hosted. The first four bits (1110) define the class here. Class EThis is a class reserved for special purposes by the Internet authority. The first four bits of this class are 1111. There is no netid or hostid in this class. 3. What is a subnet? Ans. A subnet is one of the networks that is created when a large physical network is divided intosmaller networks. 4. What is a subnet mask? Why is it necessary? Ans.

A subnet mask is a 32-bit mask used to distinguish the network ID from the host ID.In the process of routing, when a TCP/IP host sends data to another TCP/IP host, the IP at thesource host determines whether the destination host is local or remote. To determine this, IPuses the AND operation. IP ANDs the source IP address with the source subnet mask and thedestination IP address with the source subnet mask. If the ANDing results of the source anddestination addresses match, the destination host is local. If they do not match, then thedestination host is remote. 5. What are private networks? Ans. Internet authorities have reserved three blocks of address from which an organization canchoose the netid of their choice. These addresses are Class A: (netid)10.0.0 Class B: (netid)172.16 to 172.31 Class C: (netid)192.168.0 to 192.168.255Addresses with these netid are private addresses. 6. What is IP multicasting? Ans. When a data packet is sent from an individual source to a group of destinations, a multicastcommunication takes place. A multicast address is a Class D address. The whole addressdefines a multicast group id. The multicast address can never be a source IP address. It canonly be a destination addresses in an IP datagram packet.Some of the multicast addresses are: 224.0.0.1: All systems on this SUBNET 224.0.0.7: ST routers 224.0.1.7: Audio news FAQ1.

What are IP addresses? Briefly explain them P addresses are necessary for universal communication services that are independent of underlying physical network. An IP address is currently a 32-bit (4 byte) address, which canuniquely identify a host connected to the Internet. No two hosts on the Internet can have thesame IP address. In addition, IP addresses are defined such a way so that one can easilyidentify the network to which it is connected so that routing becomes easy. For example,128.11.3.31 is an IP address . What is a port address? Ans: A port address identifies the correct process (a running program on the computer) on thesource and destination host systems to which the data actually corresponds. For example, datasent by the FTP client process from system A should reach the FTP server process at thesystem B. It should not reach the MAIL server process running on the system B. So it is notonly crucial to identify the end systems to which the data meant but the end processes has tobe identified also. To achieve this, different processes are labeled uniquely. In TCP/IP, thislabeling is called as port address. A port address is 16 bits long (2 byte). 3. Explain the IP datagram format. Ans: The unit of transfer in an IP network is called an IP datagram. IP datagram has a predefinedformat in which a datagram has to be filled so that all the systems that receive it, understand itscontent without any ambiguity. It consists of an IP header and data relevant to higherlevelprotocols. A datagram is a variable length packet consisting of two parts, header and data. Theheader can be from 20 to 60 bytes long and contains information essential for routing anddelivery. The length of the data part varies from packet to packet but the total length of the IPdatagram should be within 65,535 bytes. 4. What are IP address classes? Classify the IP address classes and briefly explain them.

Ans: The InterNIC (The Internet's Network Information Center) allocates the IP addresses. The bitsthat correspond to the network ID are set to one. The bits that correspond to the host ID are setto zero. These IP addresses are divided into Class A, Class B, Class C, Class D, and Class E.End users do not use the Class D and Class E IP addresses. Class A IP address : You can have Class A IP addresses in your network if you have largenumber of hosts. The high-order bit is always set to binary 0. The next seven bits completethe network ID. The last three octets represent the host ID. The default subnet mask usedin the Class A IP address is 255.0.0.0. In addition, they have the first octet from 0-126. Thenumber of networks possible in class A IP addresses is 128. The number of hosts possibleper network is 16,777,216. For example, 11.52.36.8 is a Class A IP address. Class B IP address : You can have Class B IP addresses if your organization has mediumsized networks. The two high-order bits are always set to binary 1 0. The next 14 bitscomplete the network ID. The last two octets represent the host ID. The default subnetmask used in the Class B IP address is 255.255.0.0. In addition, they have the first octetfrom 128-191. The number of networks possible in class B IP addresses is 16,384. Thenumber of hosts possible per network is 65,536. For example, 172.52.36.8 is a Class B IPaddress. Class C IP address : Class C IP addresses are used in small local area networks. Thethree high-order bits are always set to binary 1 1 0. The next 21 bits complete the networkID. The last octet represents the host ID. The default subnet mask used in the Class C IPaddress is 255.255.255.0. In addition, they have the first octet from 192-223. The number of networks possible in class A IP addresses is 2,097,152. The number of hosts possible per network is 256. For example, 192.52.56.8 is a Class C IP address. Class D IP address

: Class D IP addresses are reserved for IP multicast addresses. Thefour high-order bits are always set to binary 1 1 1 0. The remaining bits represent thespecific group in which the client participates. Microsoft supports class D IP addresses for multicast applications to multicast data to hosts on an internetwork. These hosts aredesigned to receive multicast data. Class E IP address : The class E IP addresses are for experimental purposes. They are notin use. The four high-order bits are always set to binary 1 1 1 1 The following section provides some extra inputs on the important topics covered in the SG: Routing Protocols Routing is the process of transmitting information from one computer in a network to another computer in the same or a different network. The OSI model provides a conceptual frameworkabout how communication takes place between computers. Internet protocols and routingprotocols govern the actual process, which takes place at the Network layer of the OpenSystem Interconnection (OSI) reference model.Most networks are IP-based and use routing protocols for transmitting data. The routing of datapackets, both within a network and between networks, is made possible by a device called theRouter. A Router receives the data packet from a host device, looks at the IP address, andforwards the packet to another router or destination device. What are Routing Protocols? Routing protocols are network layer protocols that help routers identify the appropriate path for transmitting data packets between routers. Routers use routing tables to determine the networkpath in which a data packet can travel from a host computer to a destination computer. Routingtables are built using routing protocols.Routing protocols can be classified based on the type of networks or systems in which theyoperate. Routing protocols can be used to connect devices within an autonomous system or between two or more autonomous systems.Using this criterion, you can classify the routing protocols into the following two categories: Interior Gateway Protocol (IGP)

Exterior Gateway Protocol (EGP) N I I T C i n a t o r e C o m p u N e t w o r 4

o G t k

o u e s

r i r

d d

Static Routing Protocol In static routing, you manually build the routing tables of all the routers in a network byconfiguring the routers to forward data packets in predetermined routes. Routers do notexchange any information regarding the network topology.Static routing is used in small TCP/IP networks with two or more routers and a few subnets.Static routing can also be used if there is a predefined route over which data packets can travel.For example, if your ISP has provided a leased line, you can use static routing between thecustomer and ISP routers.Static routing has the following advantages:

Easy to administer Easy to troubleshoot Provides a secure environment Provides efficient utilization of resourcesHowever, static routing also has some disadvantages: Requires substantial maintenance and coordination effort Cannot adapt to changing network topology Dynamic Routing Protocol In dynamic routing, routing protocols are deployed to automatically build and maintain therouting tables of all the routers in a network. It is used in large networks with multiple routersthat can exchange information with each other to build routing tables. The information isexchanged using a routing protocol. Chapter Four QuestionsPart 11. Indicate the length of following addresses in terms of bytes:a .Ph ysic a l a d d re ss (fo r Eth e rn e t) b . I P a d d r e s s c . P o r t a d d r e s s Ans. a. Physical address (for Ethernet) : 6 bytesb. IP address : 4 bytesc. Port address : 2 bytes 2. Identify the class of the following IP addresses.a . 2 2 9 . 1 5 . 7 6 . 1 1 0 b . 1 9 1 . 32.78.27c . 4 . 5 . 6 . 7 Ans. a. 229.15.76.110 : Class Db.

191. 32.78.27 : Class Bc. 4.5.6.7 : Class A A device having more than one IP address is known as _________ device. Ans. Multihomed 4. Change the following IP address from binary to decimal point notation:011101001 01011101 00101101 10001010 Ans. 233.93.45.138 5. A device whose primary function is routing the IP datagrams over the physical network iscalledas ___________. Ans. Router 6. The two types of routing are _________ routing and _________ routing. Ans. Direct and indirect 7. The minimum length of IP datagram is __________ bytes. Ans. 576 8. The IP datagram header has the IP addresses of _______ and _________ systems. Ans .Source, destination 9. In the IP datagram __________ field is used for the error detection purpose. Ans. Checksum 10. Protocol used to find out the physical address of a destination host from its IP address isknown as _______. Ans

.ARP 11. Protocol used for reporting the errors occurred during the datagram transfer is ________. Ans .ICMP N I I T C o o r d i n a t o r G u i d e C o m p u t e r N e t w o r k s 2 6

Part 21. Write in detail about the different addressing mechanisms used in the TCP/IP model. Ans. TCP/IP model has the following three different levels of addressing: Physical address : This is the address of a node at the data link layer, as defined by theLAN or WAN. It is included in the frame sent by the data link layer. This address determinesthe host system on a particular network. The TCP/IP does not define the size and format of the physical address and it depends on the kind of the network. For example, Ethernet LANuses 6 byte (48 bit) physical address that is imprinted into the Network Interface Card.Physical addresses can be either unicast (Single recipient), multicast (a group of recipients)or broadcast (received by all in the network). However not all networks supports these.Ethernet one of the popular LAN supports all of these. Internet address : Internet addresses are necessary for universal communication servicesthat are independent of underlying physical network. Phy sical networks have differenta d d re ssin g fo rma t d e p en d in g u p on th e n e two rk te c h n o lo g y u se d . I n a d d itio n , th e addressing does not have any

component using which one can identify the network to which it is connected; which is essential for the routing purpose.The Internet addresses are designed for this purpose. An Internet address is currently a 32bit (4 byte) address, which can uniquely identify a host, connected to the Internet. No twohosts on the Internet can have the same IP address. In addition, Internet addresses aredefined such a way that given an IP address one can easily identify the network to which itis connected so that routing becomes easy. Port address : Th e I P a d d re ss a n d th e p h ysic a l a d d re ss id e n tify th e s o u rc e a n d th e destination systems. They do not identify the process (a running program on the computer)on these systems to which the data actually corresponds. The final objective of the Internetcommunication is providing a communication link between two processes running on twodifferent systems. For example, data sent by the FTP (File Transfer Protocol) client processfrom system A should reach the FTP server process at the system B. It should not reachthe MAIL server process running on the system B. So it is not only crucial to identify the endsystems to which the data meant, but also the end processes are also to be identified. Toachieve this, different processes are labeled uniquely. In TCP/IP, this labeling is called asport address. A port address is 16 bits long (2 byte). 2. Explain the different classes of IP addresses. Write briefly about, given an IP address how tofind its class. Ans. The InterNIC (The Internet's Network Information Center) allocates the IP addresses. The bitsthat correspond to the network ID are set to 1. The bits that correspond to the host ID are set to0. These IP addresses are divided into Class A, Class B, Class C, Class D, and Class E. Endusers do not use the Class D and Class E IP addresses. Class A IP address

: You can have Class A IP addresses in your network if you have largenumber of hosts. The high-order bit is always set to binary 0. The next seven bits completethe network ID. The last three octets represent the host ID. The default subnet mask usedin the Class A IP address is 255.0.0.0. In addition, they have the first octet from 0-127. Thenumber of networks possible in class A IP addresses is 128. The number of hosts possibleper network is 16,777,216. For example, 11.52.36.8 is a Class A IP address. Class B IP address : You can have Class B IP addresses if your organization has mediumsized networks. The two high-order bits are always set to binary 1 0. The next 14 bitscomplete the network ID. The last two octets represent the host ID. The default subnetmask used in the Class B IP address is 255.255.0.0. In addition, they have the first octetfrom 128-191. The number of networks possible in class B IP addresses is 16,384. Thenumber of hosts possible per network is 65,536. For example, 172.52.36.8 is a Class B IPaddress. Class C IP address : Class C IP addresses are used in small local area networks. Thethree high-order bits are always set to binary 1 1 0. The next 21 bits complete the networkID. The last octet represents the host ID. The default subnet mask used in the Class C IPaddress is 255.255.255.0. In addition, they have the first octet from 192-223. The number of networks possible in class A IP addresses is 2,097,152. The number of hosts possible per network is 256. For example, 192.52.56.8 is a Class C IP address. Class D IP address : Class D IP addresses are reserved for IP multicast addresses. Thefour high-order bits are always set to binary 1 1 1 0. The remaining bits represent thespecific group in which the client participates. Microsoft supports class D IP addresses for multicast applications to multicast data to hosts on an internetwork. These hosts aredesigned to receive multicast data. Class E IP address

: The class E IP addresses are for experimental purposes. They are notin use. The four high-order bits are always set to binary 1 1 1 1.There are two ways of determining the class of an address depending on the format it isrepresented.If the address is given in the form of binary then depending upon the first few bits one canidentify the class. If the first bit is 0 then it is Class A If the first 2 bits are 10 Class B If the first 3 bits are 110 Class C If the first 4 bits are 1110 Class D If the first 4 bits are 1111 Class EHowever mostly the addresses are given in the decimal notation, which requires followingmethod for determining the class. Class A : first number is between 0 and 127 Class B : first number is between 128 and 191 Class C : first number is between 192 and 223 Class D : first number is between 224 and 239 Class E : first number is between 240 and 255 3. Write briefly about unicast, multicast and broadcast addresses Ans.

A data packet can be sent to one system, more than one system, or to all the systems in thenetwork. The Internet addressing mechanism has provision for all of these. Unicast Addresses : Unicast communication is one-to-one. When a data packet is sent from asource system to an individual destination system, a unicast communication takes place. Allsystem on the Internet should have one unique unicast address. Unicast addresses belong toclass A, B or C. Multicast Addresses : Multicast communication is one-to-many. When a data packet is sentfrom an individual source to group of destinations, a multicast communication takes place. Amulticast address is a Class D address. The whole address defines a multicast group id. Asystem on the Internet can have one or more multicast addresses (in addition to its unicastaddress or addresses). If a system intends to participate in a particular multicast group then itshould enable corresponding multicast address in its software. Note that the multicastaddresses (or Class D) can never be a source IP address; it can only be a destination addressin an IP datagram packet. Some of the multicast addresses are listed below: 224.0.0.1 : All systems on this SUBNET 224.0.0.7 : ST routers. 224.0.1.7 : Audio news 224.0.1.11 : IETF-1-Audio 224.0.1.12 : IETF-1 Video Broadcast Addresses

: Broadcast communication is one-to-all. The Internet allowsbroadcasting only at the local network level. There are two types of broadcasting allowed. Limited broadcast : all 1s in the IP address. Both netid and hostid in this case are all 1(indecimal notation 255.255.255.255). This identifies all the hosts connected to the localnetwork. An IP datagram packet with destination address as 255.255.255.255 should bereceived by all the systems connected to the local network. Direct broadcast : This identifies all the hosts connected to a particular network (need notbe local network as in the case of Limited broadcast). Here the netid part will identify thedestination network (any valid netid) and hostid part will have all 1s. Example address is63.255.255.255. (63 identifies the Class A network and rest implies all hosts on thatnetwork) Write a brief note about direct and indirect routing. Ans.Direct Routing : If the destination host is attached to the same physical network as the sourcehost, IP datagrams can be directly exchanged. This is called direct delivery and is referred to asdirect routing. Direct routing occurs when both source and destination hosts are connected tothe same physical network. Indirect Routing : Indirect routing occurs when the destination host is not connected to anetwork directly attached to the source host. The only way to reach the destination is via one or more IP router. The address of the first router (the first hop) is called an indirect route in the IProuting algorithm. The address of the first router is the only information needed by the sourcehost to send a packet to the destination host. 5. What are the types of routing tables? Explain briefly. Ans.

The determination of routes is derived from the table known as routing table. The types of routing tables are as follows: Static routing table Dynamic routing table Static Routing Table : Routing tables can be a static one in which case the entries remainsame unless someone changes it manually. If there is any change in the Internet topology, likesome of the links going down temporarily, the entries will not be updated automatically resultingin the routing table which does not reflect the changed topology. However this simplemechanism is sufficient for many of the routers which interconnect small networks wherechanges in the topology is very unlikely or even if that happens the inconvenience caused is notmuch before the administrator updates the routing table manually. Dynamic Routing Table : A dynamic routing table is updated periodically automatically. It doesnot need the manual intervention from the administrator for the updating process. However for this the routers must have implemented one of the dynamic routing protocols such as RIP,OSPF or BGP. Basically the routers participating in dynamic routing communicate with eachother using one of the above-mentioned protocols informing about the status of the Internet byexchanging respective protocol packets. Through these communication whenever there is achange in the Internet topology, such as shutdown of a router or a link becoming inactive or even a link becoming active, the router which comes to know about such a change informs therest of the router about the change using routing protocol, so that the remaining routers updatestheir routing tables appropriately. A change in the Internet may not result in the change inrouting table at all the routers. It may affect only some of the routers. The routers in the Internetneed to be updated dynamically for efficient delivery of the IP packets. 6. Write the IP header datagram. Explain the fields Service Type, Protocol, Checksum, SourceIP address and Destination IP address. Ans. The unit of transfer in an IP network is called an IP datagram header. A datagram is a variablelength packet consisting of two parts, header and data.

The maximum length of an IP datagramis 65,535 bytes (octets). The header can be from 20 to 60 bytes long and contains informationessential for routing and delivery. The length of the data part varies from packet to packet butthe total length of the IP datagram should be within 65,535 bytes.The following are some of the fields of the header: Service Type : The service type is an indication of the quality of service requested for thisIP datagram

Protocol Checksum : This field is a checksum for the information contained in the header.I f th e h ea d e r c h e ck su m d o e s n o t ma tc h th e c o n te n ts, it imp lie s th a t th e d a ta g ra m iscorrupted and is discarded. Source IP Address : This is the 32-bit IP address of the host, sending this datagram. Destination IP Address : Th is is th e 3 2 - b it IP a d d re ss o f th e d e stin a tio n h o st, fo r th is datagram Why fragmentation is required? Explain how the IP header fields are used for the samepurpose. Ans. When an IP datagram travels from one host to another, it may pass through different physicalnetworks. Each physical network has a maximum frame size. This is called the maximumtransmission unit (MTU). It limits the length of a datagram that can be placed in one physicalframe.The format and size of the received frame depends on the protocol used by the underlyingphysical network through which the frame passes through. Since each protocol used at thephysical layer has its own MTU, there is every possibility that the incoming frame exceeds theMTU of the outgoing physical network. To enable forwarding the datagram in such cases, IPimplements a process to fragment

datagrams exceeding the MTU. The process creates a set of datagrams within the maximum size. The receiving host reassembles the original datagram.The source or any router in the path can fragment a datagram. However, only the destinationhost does the reassembly of the datagram, as each fragment becomes an independentdatagram. When a datagram is fragmented, required parts of the header must be copied by allthe fragments. The host or the router that fragments the datagram must change the values of three fields: flags, fragmentation offset, total length. The checksum field for each of thefragments has to be recomputed and duly filled.The following steps are performed to fragment the datagram: The DF flag bit in the flag field is checked to see if fragmentation is allowed. If the bit is setwhich indicates not to fragment, the datagram will be discarded as it cannot be forwardedand an ICMP error returned to the originator. Based on the MTU value, the data field of the datagram is split into two or more parts. Allnewly created data portions must have a length that is a multiple of 8 octets, with the exception of the last data portion. Each data portion is placed in an IP datagram. The headers of these datagrams are minor modifications of the original: The more fragments flag bit is set in all fragments except the last. The fragment offset field in each is set to the location this data portion occupied in theoriginal datagram, relative to the beginning of the original unfragmented datagram. Theoffset is measured in 8-octet units. The header length field of the new datagram is set. The total length field of the new datagram is set.

The header checksum field is re-calculated. Each of these fragmented datagrams is now forwarded as a normal IP datagram. IPhandles each fragment independently. The fragments can traverse different routers tothe intended destination. They can be subject to further fragmentation if they pass through networks specifying a smaller MTU. 8. Give an overview of ARP mechanism using diagrams. Ans. The ARP protocol is a network-specific standard protocol. The address resolution protocol isresponsible for converting the higher-level IP addresses to physical network addresses.IP layer provides a virtual or logical network view to the higher layer protocols where in eachhost is identified by the unique address known as IP address. However, when the datagram aresent on the physical network, this IP address cannot identify the destination system. At thephysical or data link layer, it is the physical address, which identifies the host system.Therefore, there is a need to do address translation from IP address to physical address. TheARP mechanism, which resides at the network layer in the TCP/IP protocol, performs thisaddress translation. N I I T C o o r d i n a t o r G u i d e C o m p u t e r N e t w o r k s 3 2

For this purpose, the ARP module will have a lookup table called ARP cache . This table willhave entries for all the known IP addresses. For each IP address present in the cache,corresponding

physical address is stored against it. Therefore, when ARP module is requestedto perform an address translation, it first looks into this cache. If it finds an entry for the IPaddress, it gets the corresponding physical address and returns it.However, many times there will be no entry in the cache for requested IP address. In suchcases ARP module broadcasts a message over the network requesting for the addresstranslation and after getting the proper reply stores the physical address of the IP addressrequested in the cache table and passes the same to the upper layers that requested it.Every host or the router on the network receives and processes the ARP query packet, but onlythe intended recipient recognizes the IP address and sends back the an ARP response packet.The response packet contains the recipients IP and physical addresses. The packet is unicastdirectly to the inquirer using the physical address received in the query packet. 9. Write a brief note about RARP. Ans. In some local area networks, there would be a powerful computer, which acts as a server.There would be several hosts, which will not have any disks (hard disk / floppy disk) that will beconnected to the host. People would use these hosts as the front-end system and would beconnected to the server over the network. Finally, they would be working on the server butusing these hosts as the front-end systems. Having disk-less hosts has an advantage in somesetups, where there would be a central powerful server computer on which many people canwork simultaneously by connecting through such hosts. As these hosts are disk-less system,they would not need any configuration by the administrator. Maintenance would be minimal.These disk-less systems would be booted from the ROM (Read Only Memory chip), which isprogrammed by the manufacturer. It cannot include the IP address as the network administrator assigns them.Each time these disk-less hosts are switched on, they will not be aware of their IP address, asthey do not have any disk or storage device. However, they will be aware of their hardwareaddress as encoded into the Network Interface Card, from which they can get it.Since in a network each system is

recognized by the logical or more commonly, IP address, it isvital for the system to be aware of its IP address. Any IP datagram to be sent should have thesenders IP address duly filled in. Otherwise, the recipient of that packet would not know fromwhom the packet arriver and it would just discard.To find out ones IP address these disk-less host systems, uses a protocol known as ReverseAddress Resolution Protocol. This is a protocol, which does the function opposite of that of ARPi.e. given the physical address gets the IP address.At boot up time, these disk-less hosts would broadcast a RARP request packet over thenetwork after filling its physical address in it. The server which will have a reference table of physical address and their corresponding IP address would respond with the RARP responsepacket. This reference table has entries for each of the physical address (present in the localnetwork) and their IP address would be created and maintained by the administrator. 10. What are the error reporting messages present in the ICMP? Explain any two of them. Ans. IP provides an unreliable and connectionless datagram delivery. IP protocol does not have anyerror-reporting or error-correcting mechanism. Therefore, if something goes wrong, the router does not find route for the IP packet and so discards it. The sender will be never aware of it,and he would keep resending the same. The ICMP was designed to compensate thesedeficiencies of IP. It is a companion to the IP protocol and is part of the network layer along withthe IP ICMP messages are divided into two broad categories, error-reporting messages and query messages. The error reporting messages report the problems that a router or a host may encounter when itprocesses an IP packet. They would report the problem back to the IP module at the sendingsystem.The query messages, which occur in pairs, help a host or a network manager get specificinformation from a router or another host. For example, this

can be used by the hosts todiscover the routers present in their network. The host would send an ICMP query asking for routers to respond. The routers present in the network will respond with an ICMP replymessage. The host would get enough information about the router from this reply Under error-reporting type, the following messages are present: Destination unreachable Source quench Time exceeded Parameter problem RedirectionThe query messages type has following messages: Echo request and reply Timestamp request and reply Address mask request and reply Router solicitation and advertisement FAQ1. What is the functionality of a network layer? Ans: The network layer is responsible for transferring the data from the source to the destination hostacross several physical networks. A key aspect of this transfer is the routing of packets fast,efficiently, and reliably from the source to the destination machine typically traversing a number of transmission links and network nodes where routing is carried out.The network layer also provides the virtual network concept to the upper layers. As far as theupper layers are concerned, there is only one network, and each host is recognized by a uniqueIP address. 2.

Identify the protocols used in the network layer. Ans: The following protocols are used in the network layer: IP : Internet Protocol ARP : Address Resolution Protocol RARP : Reverse Address Resolution Protocol ICMP : Internet Control Message Protocol 3. Define routing. Ans: Routing is the process by which a path is selected out of many available paths to thedestination host so that data packet reaches the destination fast, efficiently, reliably as required.It uses the destination IP address that is stored in the IP datagram packet to reach the correctdestination. 4. Define ARP. Ans: ARP (Address Resolution Protocol) is a network-specific standard protocol. ARP is responsiblefor converting the higher-level protocol addresses (IP addresses) to physical networkaddresses. N I I T C o o r d i n a t o r G u i d e C o m p u t e r N e t w o r k s 3 5

5. Define RARP. Ans: RARP (Reverse Address Resolution Protocol) is responsible for converting the physicalnetwork addresses of disk-less host systems to IP addresses. 6. Explain the working of ICMP. Ans: ICMP (Internet Control Message Protocol) is a network layer protocol and it provides error-reporting or error-correcting mechanism. In addition, ICMP provides query messages, whichoccur in pairs and it helps a host or a network manager get specific information from a router or another host. Therefore, ICMP is designed to compensate the unreliable and connectionlessdeficiencies of IP Transport Layer There may be several processes running on a computer. Thus, source to destination deliveryinvolves not only the delivery of a message from one computer system to another but also fromone process to another across the two systems. The Transport layer does this by including aservicepoint address on its header, which ensures the delivery of the message to the rightprocess. N I I T C o o r d i n a t o r G u i d e C o m p u t e r N e t w o r k s 3 7

The Transport layer also determines the type of service to provide to the Session layer and,ultimately, to the users of the network. The most popular type of transport connection is anerror-free end-to-end channel. This type of connection delivers messages in the order in whichthey were sent. The other type of transport messages is serviceand transport-isolatedmessages, which do not have a guarantee about the order of delivery and broadcasting tomultiple destinations. Reliable Delivery There are a number of aspects that the Transport layer needs to manage for reliable delivery of data between the computers on a network. These are error control, sequence control, losscontrol, and duplication control. Error control : The Transport layer implements error control by ensuring that the data sentby the sending machine is delivered at the destination machine exactly as it originated fromthe source machine. The Data Link layer takes care of error control, but only for computer-tocomputer delivery. However, the Transport layer ensures source-todestination reliabilitywh ile i mp le me n tin g e rro r c o n tro l. On e me th o d o f im p le me n tin g re lia b ility i s th ro u g h a c k n o w l e d g e m e n t s . W h e n a p a c k e t i s d e l i v e r e d t o a d e s t i n a t i o n c o m p u t e r , a n ackno wledgement of receipt is returned to the source computer. In this way, the Transportlayer tracks and validates the transmission of each packet. Sequence control

: The Transport layer is responsible for ensuring the correct sequence of data both at the senders end and at the receivers end. At the senders end, the Transportlayer receives data from the upper layers and ensures that the data is usable by the lower layers. At the receivers end, the Transport layer ensures that the data is assembledcorrectly. The Transport layer makes use of the sequence numbers. It assigns a sequencenumber to each segment that it transfers. These sequence numbers enable the message tobe reassembled in an ordered manner at the destination. The sequence numbers also helpto identify and replace the packets that are lost during transmission. Loss control : The Transport layer also ensures that all the segments of data are deliveredto the destination machine. Some segments of data may be lost during transmission due tothe segmentation of data. The Transport layer uses the sequence numbers to identify thesegments that are missing and requests for the redelivery of those segments. Duplication control : The Transport layer guarantees that none of the segments of dataa rrive s d u p lic a te d a t th e d e stin a tio n ma c h in e . I n a d d iti o n to id e n tifyin g th e missin g segments of data, the sequence numbers also help to identify and discard the segmentsthat are duplicated. Multiplexing Generally, the Transport layer creates different network connections for each transportconnection that the Session layer requires. However, if a particular transport connectionrequires a high throughput, the Transport layer might create multiple network connections anddivide the data among the network connections. Though this improves throughput, it alsoincreases the cost of creating and maintaining a network connection. Therefore, the Transportlayer might transfer and merge several transport connections into the same network connectionto reduce the cost. This process is called multiplexing. In all cases, the Transport layer isresponsible for notifying the Session layer about the multiplexing process. Multiplexing can beof two types upward and downward:

Upward : In upward multiplexing, the Transport layer uses virtual circuits depending on theservices of the layers below it. Generally, the underlying networks charge all the virtualcircuits for their established connections. By using upward multiplexing, the Transport layer sends multiple transmissions that are bound for the same destination along the same pathor circuit. By doing this, the Transport layer makes use of the established circuit in a cost-effective manner. Downward : In downward multiplexing, the Transport layer splits up a single connection intoseveral paths to improve the speed of delivery. Downward multiplexing is helpful when thecapacity of the underlying networks is low or slow n addition to multiplexing several transport connections to one network connection, theTransport layer is also responsible for establishing and deleting connections across a network.The Transport layer also implements a mechanism to regulate the flow of information, so that afast host cannot overrun a slow oneFlow Control The Transport layer ensures end-to-end flow control by using the technique of a sliding window.This window stores a set of packets that must be transmitted without waiting to receiveacknowledgements for the previously transmitted packets. In most cases, the receiver decidesthe size of the window based on the number of bytes that it can accommodate. The sender does not need to send data to completely fill the sliding window. Instead, the receiver, whilesending the acknowledgement for a previously transmitted packet, can specify that the size of the window be increased or decreased.The sliding window consists of three virtual areas. The top of the window stores packets thatare waiting to be acknowledged. In the bottom of the window, the packets that are waiting to betransmitted are stored. When an acknowledgement is received for a packet, the window slidesdown to exclude the acknowledged packet and to include a new packet in the window.

Protocols used in the Transport Layer Two core protocols that are used in the Transport layer are Transmission Control Protocol(TCP) and User Datagram Protocol (UDP). These protocols are with respect to the TCP/IPsuite. TCP is a connection-oriented protocol that assures reliable packet delivery. In other words, TCP tracks packets and verifies that a packet has reached its destination. UDP can bedescribed as a connectionless protocol that supports only packet transmission. Connection in the Transport Layer The Transport layer can be of two types connectionless or connectionoriented. When it isconnectionless, it delivers each packet of data to the destination machine individually andindependent of other packets. When the Transport layer is connection-oriented, it firstestablishes a connection with the Transport layer of the destination machine and then deliversthe packets. The connection is terminated only after all the packets are delivered. Connection-oriented transmission is considered more reliable. There are three stages in a connection-oriented transmission - connection establishment, data transfer, and connection termination.Establishing connections follows a technique called a Three Way Handshake. Before movingahead, it is important to know that computers communicate with each other through a softwareobject called an endpoint. Each endpoint is a channel consisting of the IP address and the portnumber through which the data must flow in or out of the computer. To move on, consider thefollowing procedure to understand how the Three Way Handshake works: When an application needs to establish connection with another computer, the networkingsoftware on the sending computer notifies the OS that an endpoint must be created. TheOS creates an endpoint through which the Transport layer sends an initial synchronizationpacket, also known as SYN. This step can be described as the first handshake. On receiving the SYN packet, the destination computer initiates the creation of an endpointthrough its OS. Next, the destination computer sends a SYN to the sending computer. Theacknowledgement for the received SYN is added within the SYN packet sent from thed e stin a tio n c o mp u te r. I n a dd itio n , th e se q u e n c e n u mb e r

o f th e SY N p a c k e t is a lso in c re me n te d . Th is sy n c h ro n iz e s th e se q u e nc e n umb e rin g b e twe en th e se n d in g an d receiving computers. Completing this step indicates the end of the second handshake. On receiving the SYN packet and the acknowledgement from the destination computer, thesending computer returns and acknowledgement of the destination computers SYN. Thisstep is the third handshake completing the connection process. The computers can nowstart communicating with each other Part 11. UDP is an acronym for _____________________ Ans .User Datagram Protocol 2. In the sending system, UDP receives data unit from the ______________ layer. Ans .Network 3. UDP needs the _________ address to deliver the data to the correct process. Ans. Port 4. UDP offers ______ to ______ data communication. Ans .Process-to-process 5. UDP has the fixed header size of ___ bytes. Ans .Eight 6. In TCP a unit of data is referred to as ________. Ans .Datagram 7. Flow control is achieved through the use of _____________ window mechanism. Ans .Sliding

8. _________ field in the TCP header is used to detect errors in the TCP segment. Ans .Checksum 9. In TCP, before sending data, a __________ is established between the sending andreceiving processes. Ans .Virtual path N I I T C o o r d i n a t o r G u i d e C o m p u t e r N e t w o r k s 4 1

10. TCP offers ________ duplex data transfer service. Ans. Full Part 21. Write a short note on, services offered by the UDP and what kind of applications UDP serviceis used. Ans. UDP is a connectionless, unreliable transport protocol. UDP provides process-to-processcommunication. In addition, it performs very limited error checking. UDP is very efficientbecause of its simplicity. Establishing a connection with the destination process is fast, and if reliability is not an important criterion then the transfer of data is faster for bulk transfer.The services offered by UDP are as follows: Connectionless Services : UDP provides a connectionless service. This means that eachuser datagram sent by the UDP is an independent datagram. There is no relationshipbetween the different user datagrams even if they

are coming from the same sourcep ro c e ss a n d g o in g to the sa me d e stin a tio n p ro g ra m. T h e u se r d a ta g rams a re n o tnumbered. Also, there is no connection establishment and no connection termination at thebeginning and end of a transaction. This means that each user datagram can travel adifferent path.One of the ramifications of being connectionless is that the process that uses UDP cannotsend a stream of data to UDP and expect to receive the same stream of data at thedestination. Instead each request must be small enough to fit into one user datagram. Onlythose processes sending short messages should use UDP. Otherwise if needed, the endapplication should take care of section of data arriving out of order and reordering them toget the original stream. Flow and Error Control : UDP is a very simple, unreliable transport protocol. There is nof lo w c o n tro l, a n d h e nc e n o win d o win g me c h a n ism. Th e re c e ive r ma y o ve rflo w wi th incoming messages. Again it is left for the end application to take of it. The end applicationswhich uses UDP either generates less data or they have inbuilt mechanism to take care of flow control.There is no error control mechanism in UDP except for the checksum. This means that thesender does not know if a message has been lost or duplicated. When the receiver detectsan error using the checksum, the user datagram is silently discarded. Encapsulation ad Decapsulation : To send a message from one process to another, theUDP protocol encapsulates and decapsulates the messages. Multiplexing and Demultiplexing : In a host running a TCP/IP protocol, there is only oneUDP but possibly several processes that may want to use the services of UDP. To handlethis situation, UDP uses the concept called Multiplexing and Demultiplexing.The applications at the Transport layer use the services of UDP. There are several multimediaapplications with powerful desktop computer and high bandwidth communication network thatuses UDP. The multimedia applications, which require bulk transfer of data, needs no fool-proof reliability. The reliability provided by the

underlying networks is sufficient. Loss of data to someextent is tolerable, and in fact in some cases there are techniques available to recover the lostdata with the source requiring sending it again.Todays multimedia applications, such as VoIP (Voice over IP) and Video conferencingapplications use a protocol known as RTP (Real Time Protocol) for data transfer at theapplication layer. This RTP protocol uses the services of UDP. 2. Explain how port number concept is used to offer process-process data communication inUDP. Ans n TCP/IP model, each process requiring the TCP/IP communication service is assigned a 16-bit (2 byte) number called port number. The TCP/IP standard has defined unique port numbersfor some of the well-known network application process. This helps to uniquely identify anetwork application process running on a host machine.Computer systems today support both multi-user and multiprogramming environments. Localand remote computers can run several server programs at the same time. For communication,the following hosts and processes must be defined: Local host Local process Remote host Remote processThe local host and the remote host are identified using IP addresses. To define the processes,we need second identifiers, which are called port numbers. In the TCP/IP protocol suite, theport numbers are integers between 0 and 65,535.The client program is assigned a port number, chosen randomly by the UDP software runningon the client host. This is the ephemeral port number.The server process must also be assigned a port number. This port number, however, cannotbe chosen randomly. If the computer at the server site runs a server process and assigns arandom number as the port number, the process at the client site that wants to access thatserver and use its services will not know the port number. Therefore, TCP/IP has decided

touse universal port numbers for servers; these are called well-known port numbers. Every clientprocess knows the well-known port number of the corresponding server process.The destination IP address defines the host among the different hosts in the Internet. After thehost has been selected, the port number selects one of the intended processes on thisparticular host. 3. Write the UDP datagram header. Explain each field. Ans. UDP packets, known as user datagrams, have a fixed-size header of eight bytes.The fields of UDP packets are explained below: Source port number : This is the port number of the source process sending the UDPdatagram. It is 16 bits long (2 byte). If the source process is a client (a client sending arequest), the port number, in most cases, is an ephemeral port number. If the sourceprocess is a server (a server sending a response), the port number, in most cases, is awell-known port number. Destination port number : This is the port number of the destination process to which thisUDP datagram is meant. It is also 16 bits long. Its characteristics are similar to the SourcePort Number. Length : This is a 16-bit field that defines the total length of the UDP datagram, header plusdata. The 16 bits can define a total length of 0 to 65,535 bytes. However, the minimumlength is eight bytes, which indicates a user datagram with only header and no data.Ho we ve r it sh o u ld b e n o ted th a t I P h a s a l i mita t io n o f 6 5 ,5 3 5 b yte s fo r its d a ta g ra m. Therefore, the length of the data can be between 0 and 65,507 (65,535 20 8) bytes(twenty bytes for IP header and 8 bytes for UDP header).The UDP length can be computed using data length in the IP header. However, thedesigners of UDP protocol felt that it was more efficient for the destination UDP to calculatethe length of the data from the information provided in the UDP datagram rather than askingto

supply this information. We should remember that when the IP module delivers the UDPuser datagram to the UDP layer, it has already dropped the IP header. Checksum : This field is used to detect errors over the entire user datagram (header plusdata). Unlike lower layer protocols like IP, which provide checksum only for their header,this provides the checksum for entire datagram, which includes the data sent by the user process. N I I T C o o r d i n a t o r G u i d e C o m p u t e r N e t w o r k s 4 3

4. Describe how checksum is calculated for the UDP datagram. Ans. UDP checksum calculation includes three sections: Pseudo header: The pseudo header is part of the header of the IP packet in which the user datagram is to be encapsulated for transmission with some fields with 0s. UDP header: Header for this UDP datagram. User Data: Data sent by the upper layer.The pseudoheader is added to ensure that the user datagram reaches the intended process,which uses the intended transport protocol on the intended host. Since in no other layer, it ispossible to check all these three, a pseudoheader derived from the IP header that hasdestination and source IP address and protocol numbers is used. The pseudoheader along withthe UDP header uniquely identifies the destination process. Checksum Calculation at the Source : At the source host system, the sender follows thesesteps to calculate the checksum:1.Add the pseudoheader to the UDP user

datagram.2.If the total number of bytes is not even, add one byte of padding (all 0s). The padding isonly for the purpose of calculating the checksum and will be discarded afterwards.3 .F ill th e c h e c k su m fie ld with z e ro s. 4.Divide the total bits into 16-bit (two-byte) words sections.5.Add all 16- bit sections using ones complement arithmetic.6.Take ones complement of the result (change 0s to 1s and all original 1s to 0s), which is a16-bit checksum number.Once 16 bits checksum field is computed using the above method, it is filled into the originalUDP header and the resulting UDP datagram is sent. It should be noted that the pseudoheader and the padding bits are not sent but only used during the computation of checksum. Checksum Calculation at Destination Host : The receiver follows these steps to calculate thechecksum:7 . O b t a i n t h e I P h e a d e r , d e r i v e t h e pseudoheader from it, and add it t o t h e U D P u s e r datagram.8 . A d d p a d d i n g i f n e e d e d . 9 .D ivid e th e to ta l b its in to 1 6 -b it se c tio n s. 10.Add all 16-bit sections using ones complement arithmetic.11.Take ones complement the result to get the checksum.UDP datagram is accepted if the resulting checksum is all 0s. Otherwise it is discarded, as itindicates an error in it. 5. Explain the Encapsulation and Decapsulation mechanism used in UDP. Ans.Encapsulation : When a process has a message to send through UDP, it passes the messageto UDP along with a pair of socket addresses and the length of data. UDP receives the dataand adds the UDP header. UDP then passes the user datagram to the IP with the socketaddresses. IP adds its own header, using the value 17 in the protocol field, indicating that thedata has come from the UDP protocol. The IP datagram is then passed to the data link layer.The data link layer receives the IP datagram, adds its own header (and possibly a trailer), andpasses it to the physical layer. The physical layer encodes the bits into electrical or opticalsignals and sends it to the remote machine. Decapsulation : When the message arrives at the destination host, the physical layer decodesthe signals into bits and passes it to the link layer. The data link uses the header (and thetrailer) to check the data. If there is no error, the

header and trailer are dropped and thedatagram is passed to the IP. The IP software does its own checking. If there is no error, theheader is dropped and the user datagram is passed to the UDP with the sender and receiver IP addresses. UDP uses the checksum to check the entire user datagram. If there is no error, theheader is dropped and the application data along with the sender socket address is passed tthe process. The sender socket address is passed to the process in case it needs to respondto the message received. 6. Write a short note on importance of TCP. Ans. The protocol, which is responsible for widespread usage of TCP/IP model for computer-to-computer communication network is the TCP. It is the combination of TCP at the Transportlayer and IP at the Network layer, which is largely responsible for success of this model.The network application program, which needs to communicate over the network, expects avery simple, easy to implement communication channel. If a user wants to write an applicationprogram, which communicates with another over the network, he should not be expected tobuild logic into his program to take care of so many issues that are involved in thecommunication. He should not worry about things such as, some part of the message gettingcorrupted or lost. There are other issues which should not be handled by him, like rearrangingthe datagrams which arriver out of order, issues of congestion and resulting delay, issues of flow control by which the rate at which the source sends the data can be controlled.TCP ensures easy to use communication channel, which provides the reliable, stream orientedcommunication service, which takes are of such error and flow control mechanisms.IP provides an unreliable, best-effort, datagram service and UDP adds just the process-to-process communication facility apart from error checking mechanism to some extent.Therefore, there is a need for another protocol, which sits on top of the IP and provides theservices as mentioned above to the end application. So the designer of TCP/IP model came outwith TCP at the Transport layer.TCP provides process-to-process communication channel, which is reliable and streamoriented in nature. In addition, it takes care of the error-control

and flow control.The process-to-process mechanism is very similar to the one used by UDP. Port numbers areused to identify an individual process. Association of IP address and port number is known asthe socket. A socket identifies each communicating process and a pair of socket determines thecommunication channel. A port number can be shared by both UDP as well as TCP. I.e. therecan be a port number, which is assigned to two processes at the same host, but which usesdifferent protocols, one process uses UDP and another TCP. Port number does not identify theprotocol. The protocol field in the IP header makes that distinction. 7. Explain the stream-oriented data transfer offered by the TCP. Ans. TCP provides stream data transfer service, which means the destination process receives thestream of data in exactly the same manner it is sent by the source process. Unlike in datagramservice, there is no concept of unit of data transfer. In datagram service, all the data have to besent as a single unit. This imposes two restrictions. One restriction is that all the data should beavailable at the time of sending. Otherwise, they will be sent in another datagram. Eachdatagram unit is a separate entity and there is no relation between them. Another restriction ison the size of the data transfer.Source TCP accepts a stream of characters from the sending application program as and whenthey arrive, creates packets, called segments, of appropriate size extracted from the stream,and sends them across the network. The receiving TCP receives segments, extracts data fromthem, orders them if they have arrived out of order, and delivers them as a stream of charactersto the receiving application program.For stream delivery, the sending and receiving TCPs use buffers. The sending TCP uses asending buffer to store the data coming from the sending application program. The sendingapplication program delivers data at the rate it is created. For example, if the user is typing the N I I T C o o r d i n a t o r G u i d e C o m p u t e r N e t w o r k s 4 5

data on a keyboard, the data is delivered to the sending TCP character by character. If the datais coming from a file, data may be delivered to the sending TCP line-by-line, or block-by-block.The sending application program writes data to the buffer of the sending TCP. However, thesending TCP does not create a segment of data for each write operation issued from thesending application program. TCP may choose to combine the result of several write operationsinto one segment to make transmission more efficient.The receiving TCP receives the segments and stores them in a receiving buffer. The receivingapplication program uses the read operation to read the data from the receiving buffer, but itdoes not have to read all of the data contained in one segment in one operation. Since the rateof reading can be slower than the rate of receiving, the data is kept in the buffer until thereceiving application reads if completely . Write a diagram of TCP header. Explain the fields, Sequence number, Acknowledgementnumber, Window size and Urgent pointer. Ans. In TCP, a unit of data transfer is known as TCP segment. Since TCP provides the stream-oriented data service, it uses the concept of segment for a unit of transfer.The segment consists of a 20-to 60-byte header, followed by data from the application program.The header is 20 bytes if there are no options and up to 60 bytes if it contains some options.Some of the header fields are as follows: Source port address : This is a 16-bit (2 bytes) field that defines the port number of theapplication program in the host that is sending the segment. Destination port address : This is a 16-bit (2 bytes) field that defines the port number of the application program in the host that is receiving the segment. Sequence number : This 32-bit (4 bytes) field defines the number assigned to the first byteo f d a ta c o n ta in e d in th is se g me n t. TC P is a stre a m tra n sp o rt p ro to c o l. To e n su re connectivity, each byte to be

transmitted is numbered. The sequence number informs thedestination the position of the first byte of this segment in the original stream of data at thesource. Acknowledgement number : This 32-bit (4 bytes) field defines the byte number that thesource of the segment is expecting to receive from the other end process. If host hasreceived successfully till byte number n from the other host, then it defines n + 1 as the acknowledgement number, which indicates it is expecting data starting from location n+1 atthe other hosts stream. Header length : This four-bit field indicates the length of the TCP header. It is equal tonumber of four-byte words in the TCP header. The length of the header can be between 20and 60 bytes. Therefore, the value of this field can be between 5 (5 x 4 = 20) and 15 (15 x4 = 60). Reserved : This is a six-bit field reserved for future use. Control : This field defines six different control bits or flags as shown in figure. One or moreof these bits can be set at a time. These bits enable flow control, connection establishmentand termination, and the mode of data transfer in TCP. A brief description of each bit is given below: URG : The value of urgent pointer is valid. ACK : The value of acknowledgement field is valid. PSH : Request to push the data RST : Request to reset the connection.

SYN : Request to synchronize the sequence number during connection FIN : Request to terminate the connection. Window size : This field defines the size of the window, in bytes, that the other end mustmaintain. The length of this field is 16 bits, which means that the maximum size of thewindow is 65,535 bytes. Checksum : This 16-bit (2 bytes) field contains the checksum, used for error checkingpurpose. Urgent pointer : This 16-bit field, which is valid only if the urgent flag is set, is used whenth e se g men t c o n ta in s u rg e n t d a ta . I t d e fi n e s th e n u mb e r th a t mu st b e a d d e d to th e sequence number to obtain the number of the last urgent byte in the data section of thesegment. Options : There can be up to 40 bytes of optional information in the TCP header. 9. Describe briefly how error-control mechanism is achieved in TCP when data is corrupted,and when acknowledgement is lost. Ans. TCP is a reliable transport layer protocol. This means that an application program that deliversa stream of data to TCP relies on TCP to deliver the entire stream to the application program on N I I T C o o r d i n a t o r G u i d e C o m p u t e r N e t w o r k s 4 7

the other end in order, without error, and without any part lost or duplicated. TCP providesreliability using error control. Error control includes mechanisms for detecting corruptedsegments, lost segments, out-of-order segments, and duplicated segments. Error control alsoincludes a mechanism for correcting errors after they are detected. Error Detection and correction : Error detection in TCP is achieved through the use of threesimple tools: checksum, acknowledgement, and time-out. Time-out is the duration for which thesending TCP waits for the acknowledgement, after which it considers whether the data sent iseither corrupted or lost and retransmits the same.Each segment includes the checksum field, which is used to check for a corrupted segment. Bycomputing checksum, one can find whether the segment is corrupted or not. If it is corrupted, itis discarded by the destination TCP. TCP uses the acknowledgement method to confirm thereceipt of those segments that have reached the destination TCP uncorrupted. If a segment isnot acknowledged before the time-out, it is considered to be either corrupted or lost.The error-correction mechanism used by TCP is also very simple. The source TCP starts onetime-out counter for each segment sent. Each counter is checked periodically. When a counter expires, the corresponding segment is considered to be either corrupted or lost, and thesegment will be retransmitted.Consider an example where data becomes corrupted while it is sent from one host to another.In this example the source host sends segments 1 through 3, each 200 bytes. The sequencenumber begins at 1,201 on segment 1. The receiving TCP receives segments 1 and 2, usingthe checksum, finds them error free. It acknowledges the receipt of segments 1 and 2 usingacknowledgement number 1,601, which means that it has received bytes 1,201 to 1,600 safeand sound, and is expecting to receive byte 1,601. However, it finds that segment 3 to becorrupted and discards segment 3. Note that although it has received bytes 1,601 to 1,800 insegment 3, the destination does not consider this as a receipt because this segment wascorrupted. After the time-out for segment 3 expires, the source TCP will resend segment 3.After receiving segment 3, the destination sends the acknowledgement for byte 1,801, whichindicates that it has received bytes 1,201 to 1,800 error

free.Consider an example where acknowledgement is lost while data is sent from one host toanother. In the TCP acknowledgement mechanism, a lost acknowledgement may not even benoticed by the source TCP. TCP uses an accumulative acknowledgement system. Eachacknowledgement is a confirmation that everything up to the byte specified by theacknowledgement number has been received. For example, if the destination sends an ACKsegment with an acknowledgement number for byte 1,801, it is confirming that bytes 1,201 to1,800 have been received. If the destination had previously sent an acknowledgement for byte1,601, meaning it has received bytes 1,202 to 1,600, loss of the acknowledgement is totallyirrelevant. 10. Explain why one needs the service of Urgent Data operation of TCP. Ans. TCP is a stream-oriented protocol. This means that the data is presented from the applicationprogram to the TCP as a stream of characters. Each byte of data has a position in the stream.However, there are occasions in which an application program needs to send urgent bytes.This means that the sending application program wants a piece of data to be read out of order by the receiving application program. Suppose that the sending application program is sendingdata to be processed by the receiving application program. When the result of processingcomes back, the sending application program finds that everything is wrong. It wants to abortthe process, but it has already sent a huge amount of data. If it issues an abort command(Control + C), these two characters will be stored at the end of the receiving TCP buffer. It willbe delivered to the receiving application program after all the data has been processed.The solution is to send a segment with the URG bit set. The sending application program tellsthe sending TCP that the piece of data is urgent. The sending TCP creates a segment andinserts the urgent data at the beginning of the segment. The rest of the segment can containnormal data from the buffer. The urgent pointer field in the header defines the end of the urgentdata and the start of normal data. When the receiving TCP receives a segment with the URG bit set, it extracts the urgent datafrom the segment, using the value of the urgent pointer, and delivers it, out of order, to thereceiving

application program. Explain the concept of Multiplexing and Demultiplexing in TCP. Ans. The concept of multiplexing and demultiplexing operation is as follows: Multiplexing : At the source host, there may be several processes that need to send user datagrams. However, there is only one TCP. This is a manyto-one relationship andrequires multiplexing. TCP accepts messages from different processes; each message willhave a port number assigned to it, which identifies the process, which generated themessage. After adding the header, TCP passes the user datagram to IP. Demultiplexing : At the receiver site, there is only one TCP. However, we may have manyprocesses that can receive user datagrams. This is a oneto-many relationship andrequires demultiplexing. TCP receives user datagrams from IP. After error checking anddropping of the header, TCP delivers each message to the appropriate process based onthe port numbers. 12. Explain the need of Pushing Data operation in TCP. Ans. In certain situations, the sending TCP uses a buffer to store the stream of data coming from thesending application program. The sending TCP has the choice to create segments of any sizefrom the stream. The receiving TCP also buffers the data when they arrive and delivers them tothe application program when the application program is ready or when the receiving TCP feelsthat it is convenient. This type of flexibility increases the efficiency of TCP.However, there are occasions in which the application program is not comfortable with thisflexibility. For example, consider an application program that communicates interactively withanother application program on the other end. The application program on one site wants tosend a keystroke to the application at the other site and receive an immediate response.Delayed transmission and delayed delivery of data may not be

acceptable by the applicationprogram.TCP can handle such a situation. The application program on the sending site can request apush operation. This means that the sending TCP should not wait for the window to be filled. Itshould create a segment and send it immediately. The sending TCP should also set the pushbit (PSH) to tell the receiving TCP that the segment includes data that must be delivered to thereceiving application program as soon as possible and not to wait for more data to come.Although the push operation can be dictated by the application program, today mostimplementations ignore such requests. TCP has the choice to use this operation or not. 13. Explain how connection is established in TCP using three-way hand shaking. Ans. The connection establishment in TCP is called three-way handshaking. In this procedure, anapplication program, called the client, wants to make a connection with another applicationprogram, called the server, using TCP as the transport layer protocol.The three-way handshaking procedure starts with the server. The server program tells its TCPthat it is ready to accept a connection. This is called a request for a passive open.The client program makes a request for an active open. A client that wishes to connect to aserver tells its TCP that it needs to be connected to a particular server. The clients TCP cannow start the three-way handshaking process.The steps of the process are as follows:The client sends the first segment, with the SYN bit set, which is known as SYN segment. Thesegment includes the source and destination port numbers. The destination port number clearly defines the server to which the client wants to be connected. The segment alsocontains the client Initialization Sequence Number (ISN) used for numbering the bytes of data N I I T C o o r d i n a t o r G u i d e C o m p u t e r N e t w o r k s 5 0

sent from the client to the server. If the client needs a large window, it defines the window scalefactor here using the appropriate option. This segment defines the wish of the client to make aconnection with certain parameters.The server sends the second segment, a SYN and ACK segment. This segment has a dualpurpose. First, it acknowledges the receipt of the first segment using the ACK flag andacknowledgement number field. The acknowledgement is the client initialization sequencenumber plus one. The server must also define the client window size. Second, the segment isused as the initialization segment for the server. It contains the initialization segment for theserver and initialization sequence number used to number the bytes sent from the server. Asmentioned before, this is two segments combined into one.The client sends the third segment. This is just an ACK segment. It acknowledges the receiptof the second segment using the ACK flag and acknowledgement number field. Theacknowledgement number is the server initialization sequence number plus one. The clientmust also define the server window size. Note that data can be sent with the third packet. 14. Describe briefly how Flow-control is achieved in TCP using sliding window mechanism. Ans. To accomplish flow control, TCP uses a sliding window protocol. With this method, both hostsuse a window for each connection. The window covers a portion of the buffer that a host cansend before worrying about an acknowledgement from the other host. The window is called asliding window because it slides over the buffer as the receiver sends acknowledgement of thebytes received without any error. Consider a sliding window of size 10. Before receiving anyacknowledgement from the destination, the source can send up to 10 bytes. However, if itreceives acknowledgement of the first three bytes, it can slide the window three bytes to theright. This means that now it can send 10 more bytes before worrying about anacknowledgement.The previous example shown is a fixed size window. However flow-control needs the size of thewindow to vary to achieve the flow control. Hence in TCP window size is variable. Thedestination, in each acknowledgement

segment, can define the size of the window. Theadvertised size is relative to the acknowledgement number. For example, if the receiver acknowledges the receipt of byte 3,000 and defines the size of the window to be 200, it meansthat the window now expands from byte 3001 to byte 3,200.The destination can also increase or decrease the size of the window in an acknowledgementsegment. FAQ1. What does process-to-process communication mean? Ans: There may be several processes running on a computer. Thus, source to destination deliveryinvolves not only the delivery of a message from one computer system to another but also fromone process to another across the two systems. The Transport layer does this by including aservicepoint address on its header, which ensures the delivery of the message to the rightprocess. 2. What is a socket address? Ans: Socket address is a combination of an IP address and a port number. 3. What is checksum? Ans: The error detection method used by most of the TCP/IP protocols is called checksum. Thechecksum protects against the corruption that may occur during the transmission of a packet How does TCP ensure reliable data delivery? Ans: There are a number of aspects that TCP needs to manage for reliable delivery of data betweenthe computers on a network. These are error control, sequence control, loss control, andduplication control: Error control : TCP implements error control by ensuring that the data sent by the sendingmachine is delivered at the destination machine exactly as it originated from the sourcemachine. The Data Link layer takes care of error control, but only for computer-to-computer delivery. However, TCP ensures source-to-destination reliability while

implementing error control. One method of implementing reliability is through acknowledgements. When apacket is delivered to a destination computer, an acknowledgement of receipt is returned tothe source computer. In this way, the Transport layer tracks and validates the transmissionof each packet. Sequence control : TCP is responsible for ensuring the correct sequence of data both atth e se n d e r s en d a n d a t th e re c e ive r s e n d . A t th e se n d e r s e n d , th e Tra n sp o rt la ye r receives data from the upper layers and ensures that the data is usable by the lower layers.At the receivers end, the Transport layer ensures that the data is assembled correctly. TCPalso makes use of the sequence numbers. It assigns a sequence number to each segmentthat it transfers. These sequence numbers enable the message to be reassembled in anordered manner at the destination. The sequence numbers also help to identify and replacethe packets that are lost during transmission. Loss control : TC P a lso e n su re s th a t a ll th e se g me n ts o f d ata a re d e live re d to th e destination machine. Some segments of data may be lost during transmission due to thesegmentation of data. TCP uses the sequence numbers to identify the segments that aremissing and requests for the redelivery of those segments. Duplication control : TCP guarantees that none of the segments of data arrive duplicatedat the destination machine. In addition to identifying the missing segments of data, thesequence numbers also help to identify and discard the segments that are duplicated. 5. What is buffer? Ans: A buffer is a data area shared by hardware devices or program processes that operate atdifferent speeds or with different sets of priorities. The buffer allows each device or process tooperate without being held up by the other. In order for a buffer to be effective,

the size of thebuffer and the algorithms for moving data into and out of the buffer need to be considered bythe buffer designer. For stream delivery, the sending and receiving TCPs use buffers. Thesending TCP uses a buffer to store the data coming from the sending application program. Thereceiving TCP receives the segments and stores them in a receiving buffer. The receivingapplication program uses the read operation to read the data from the receiving buffer, but itdoes not have to read all of the data contained in one segment in one operation. Since the rateof reading can be slower than the rate of receiving, the data is kept in the buffer until thereceiving application reads if completely. 6. What is full duplex service? Ans: TCP offers full-duplex service , where data can flow in both directions at the same time. After two application programs are connected to each other, they can both send and receive data.One TCP connection can carry data from application A to B and at the same time, from B to A.When a packet is going from A to B, it can also carry an acknowledgement of the packetsreceived from B. Likewise, when a packet is going from B to A, it can also carry anacknowledgement of the packets received from A. This is called piggybacking becauseacknowledgements can be sent with data. N I I T C o o r d i n a t o r G u i d e C o m p u t e r N e t w o r k s 5 3

7. What is an out-of-order segment? Ans: TCP uses the services of IP, an unreliable, connectionless network layer protocol. The TCPsegment is encapsulated in an IP datagram. Each datagram is an independent entity. Therouters are free to send each datagram through any route they find suitable. One datagrammay follow

a route with a short delay; another may follow another route with a longer delay.Therefore, datagrams may arrive out of order. If datagrams arrive out of order, the TCPsegments that are encapsulated in the datagrams will be out of order as well. This is called anout-of-order segment. 8. What is the difference between pushing data and urgent data? Ans: The difference between pushing data and urgent data is: Pushing data : The application program on the sending site can request a push operation.This means that the sending TCP should not wait for the sliding window to be filled. Itshould create a segment and send it immediately. The sending TCP should also set thepush bit (PSH) to inform the receiving TCP that the segment includes data that must bedelivered to the receiving application program as soon as possible and not to wait for moredata to come. Urgent data : Consider a situation where an application program needs to send urgentbytes. This means that the sending application program wants a piece of data to be readout of order by the receiving application program. Suppose that the sending applicationprogram is sending data to be processed by the receiving application program. When theresult of processing comes back, the sending application program finds that everything iswrong. It wants to abort the process, but it has already sent a huge amount of data. If itissues an abort command (Control + C), these two characters will be stored at the end of the receiving TCP buffer. It will be delivered to the receiving application program after allthe data has been processed.The solution is to send a segment with the URG bit set. The sending application program tellsthe sending TCP that the piece of data is urgent. The sending TCP creates a segment andinserts the urgent data at the beginning of the segment. The rest of the segment can containnormal data from the buffer. The urgent pointer field in the header defines the end of the urgentdata and the start of normal data.When the receiving TCP receives a segment with the URG bit set, it extracts the urgent datafrom the segment,

using the value of the urgent pointer, and delivers it, out of order, to thereceiving application program. 9. Identify the two protocols present in the Transport layer. Ans: The two protocols present in the Transport layer are UDP and TCP. 10. What is the length of following addresses in terms of bytes?a . P h y s i c a l a d d r e s s b . I P a d d r e s s c . P o r t a d d r e ss Ans: a. Physical address : 6 bytesb. IP address : 4 bytesc. Port address : 2 bytes The following section provides some extra inputs on the important topics covered in the SG: The Application Layer The Application layer is the layer closest to the end-user. This layer provides protocols that arecommonly needed and provides an interface that applications use to access network resources.For example, a fullscreen editor that is supposed to work over a network generally has to workwith many different terminal types. Each terminal may have different screen layouts; escapesequences for inserting and deleting text, moving the cursor, etc. In this situation, it is verydifficult for the screen editor to work with the incompatible terminal types.One way to solve this problem is to define an abstract network virtual terminal. This virtualterminal is managed by using editors and other programs. To handle each terminal type, a codemust be written to map the functions of the network virtual terminal with the real terminal. For example, when the editor moves the virtual terminal's cursor to the upper left-hand corner of thescreen, the proper command sequence must be issued to the real terminal to get its cursor there too. The entire virtual terminal software is in the Application layer.Thus, the main function of the Application layer is to

provide network services to the end-user or the computer application. Computer applications can be divided into three groups: Network applications : These applications are specifically designed for working on anetwork. For example, using the Telnet program, you can connect to a remote machine andoperate it. Standalone applications : These application programs are for individual access and arenot designed for a network. Solitaire is an example of a standalone application. Embedded applications : These applications have other network applications imbedded inthem. Microsoft Word is an example of an imbedded application as it allows you to imbedand activate e-mail or Web site references within a document. N I I T C o o r d i n a t o r G u i d e C o m p u t e r N e t w o r k s 5 5

Another important function of the Application layer is file transfer. The Application layer handlesthe different file systems because they have different file naming conventions, different ways of representing text lines, and so on. The Application layer also handles e-mail, remote job entries,directory lookups, and various other general-purpose and specialpurpose facilities. Protocols in the Application Layer The Application Layer implements a host of protocols that provide network connectivity anddata transfer services for users. Some Application layer protocols include File Transfer Protocol(FTP), Telnet, Simple Mail Transfer Protocol (SMTP), Hypertext Transfer Protocol (HTTP),Simple Network Management Protocol (SNMP), Domain Naming Service (DNS), and DynamicHost Configuration Protocol (DHCP). The following table provides a brief description of theseprotocols: F T P F T P i s u s e d t o t r a n s f e r f i l e s f r o m o n e s y s t e m t o a n o t h e r on a network.T e l n e t T e l n e t i s u s e d t o a c c e s s a r e m o t e s y s t e m o n a n e t w o r k and perform operations on it.S M T P S M T P i s u s e d t o t r a n s f e r e m a i l m e s s a g e s b e t w e e n t h e mail servers on a network, or between mail clients and a mail server.H T T P H T T P i s u s e d t o e x c h a n g e t e x t , g r a p h i c s , i m a g e , a u d i o , and video files over the WWW.S N M P S N M P i s u s e d t o m o n i t o r a n d m a n a g e n e t w o r k d e v i c e s and their functions.D N S D N S i s u s e d p r i m a r i l y t o m a p o r r e s o l v e a h o s t n a m e t o an IP

address.D H C P D H C P i s u s e d t o d y n a m i c a l l y a l l o c a t e I P a d d r e s s e s o n a network. Chapter Six QuestionsPart 11. In TCP/IP model, the session and presentation layers are integrated with _________ layer. Ans .Application 2. In TCP/IP the two communicating process can be best described using the __________________ model. Ans .Client-server 3. In client-server, the _________ program is always running. Ans .Server N I I T C o o r d i n a t o r G u i d e C o m p u t e r N e t w o r k s 5 6 . Connection-oriented concurrent server uses the service of ________ transport protocol. Ans .TCP 5. In client-server model, a user wanting a particular service runs the ________ program. Ans .Application 6. FTP is used to transfer ________ from one host to another. Ans .Files 7. FTP uses _________ protocol, for transmission purpose.

Ans .File transfer 8. The number of connections required for FTP operation is ______. Ans .Two 9. Commands are sent over ________ connection. Ans .Control 10. Information regarding the file, such as file type, structure, and transmission mode are sentto the server _______ the data transfer takes place. Ans .Before Part 21. Write a brief description about Client-server model. Ans. The purpose of a TCP/IP or Internet is to provide data communication services to users. Thehurdles created because of the geographical distance while accessing information from another host should be minimized. If a user at a local host computer wishes to receive a service from acomputer at a remote site. Computer executes specific programs to perform the specific job.There would be a program to do the Word processing, a program to browse the web site and soon. In other words for data communication to take place, a computer runs a program to requesta service from another program residing on the destination computer. This means that twocomputers connected by an Internet should each run a program, one to provide a service andone to request a service.It is important to determine beforehand, who makes the request for service and who offers it.Issue of whether both the application programs are able to request services and provide services or should the application programs just do one or the other, must be resolved. Onesolution is to have an application program, called the client, running on the local host computer,request a service from another application program, called the server, running on the remotecomputer. In other words, the task of requesting program is

either a requester (a client), or aprovider (a server). If a machine needs to request a service and provide a service, twoapplication programs must be installed. In other words, application programs come in pairs.An application program in a client server model provides services to any application programinstalled anywhere in an Internet that requests this service. Therefore, a server provides serviceto any client. In other words, the client-server relationship is many-to-one. Many clients can usethe services of one server.In a client server model, a client program, which requests a service, should run only when it isneeded. The server program, which provides a service, should run all the time because it doesnot know when its service is needed. 2. What is a connectionless-iterative server? Using a diagram explain the same. Ans. The servers that use UDP are normally iterative, which means that the server processes onerequest at a time. A server gets the request received in a datagram from UDP, processes therequest, and gives the response to UDP to send to the client. The server pays no attention tothe other datagrams. These datagrams are stored in a queue, waiting for service. They couldall be from one client or from many clients. In either case they are processed one by one inorder of arrival.The following figure illustrates the same: Connectionless-Iterative Server 3. Write a brief description about the connection-oriented concurrent server.Ans.The servers that use TCP are normally concurrent. This means that the server can servemany clients at the same time. Communication is connection-oriented, which meansthat a request is a stream of bytes that can arrive in several segments and the response canoccupy several segments. A connection is established between the server and each client, and N I I T C o o r d i n a t o r G u i d e C o m p u t e r N e t w o r k s 5 8

the connection remains open until the entire stream is processed and the connection isterminated.This type of server cannot use only one wellknown port because each connection needs a portand many connections may be open at the same time. Many ports are needed, but a server canuse only onewell-known port. The solution is to have one well-known port and many ephemeral ports. Theserver makes a passive open at the wellknown port. A client can make its initial approach tothis port to make the connection. After the connection is made, the server assigns a temporaryport to this connection to free the well-known port. Data transfer can now take place betweenthese two temporary ports, one at the client site and the other at the server site. The well-known port is now free for another client to make the connection. The idea is to pushdemultiplexing to TCP instead of the server.The server must also have one buffer for each connection. The segments coming from theclient are stored in the appropriate buffer, and will be served concurrently by the server.To provide this service, most implementations use the concept of parent and child servers. Aserver running infinitely and accepting connections from the clients is called a parent server.The parent uses the well-known port. After it makes a connection, the parent server creates achild server and an ephemeral port and lets the child server handle he service. It thereby freesitself so that it can wait for another connection. 4. Explain the concept of process. Ans. A process is an instance of a program. When the operating system executes a program, aninstance of the program, a process, is created. The operating system can create severalprocesses from one program, which means several instances of the same program are runningat the same time (concurrently). Although all processes have the same data types, memory isallocated for each process separately. In addition, the values stored in variables may be totallydifferent from one process to another. The functions executed by each process of the sameprogram may differ, as each may take different inputs. 5. Write a short note on FTP. Ans.

File transfer protocol (FTP) is the standard mechanism provided by TCP/IP for copying a filefrom one host to another. Transferring files from one computer to another is one of the mostcommon tasks expected from the networking environment.Although transferring files from one system to another seems simple and straightforward, someproblems must be dealt with first. For example, two systems may use different file nameconventions. Two systems may have different ways to represent text and data. Two systemsmay have different directory structures. All of these problems have been solved by FTP in avery simple and elegant approach.FTP differs from other client-server applications in that it establishes two connections betweenthe hosts. One connection is used for data transfer, the other for control information(commands and responses). Separation of commands and data transfer makes FTP moreefficient. The control connection uses very simple rules of communication. We need to transfer only a line of command or a line of response at a time. The data connection, on the other hand,needs more complex rules due to the variety of data type transferred.FTP uses two well-known TCP ports, Port 21 is used for the control connection, and port 20 isused for the data connection.The client has three components: user interface, client control process, and the client datatransfer process. The server has two components: the server control process and the server data transfer process. The control connection is made between the control processes. Thedata connection is made between the data processes. The control connection remains N I I T C o o r d i n a t o r G u i d e C o m p u t e r N e t w o r k s 5 9

connected during the entire interactive FTP session. The data connection is opened and thenclosed for each file transferred. It opens each time commands that involve transferring files areused, and it closes when the file is transferred. Similarly, when a user starts an FTP session,the control connection is opened. While the control connection is open, the data

connectioncan be opened and closed multiple times if several files are transferred.The two FTP connections control and data use different strategies and different port numbers Write a brief description about the control connection used in FTP. Ans. The control connection is created in the same way as other application programs described sofar.There are two steps:12.The server issues a passive open on the well-known port 21 and waits for a client.13.The client uses an ephemeral port and issues an active open connection to the port 21 of server process.The connection remains open during the entire process. The service type, used by the IPprotocol, is to minimize delay because this is an interactive connection between a user (human)and a server. The user types commands and expects to receive responses without significantdelay. After the initial connection, the server process creates a child process and assigns theduty of serving the client to the child process using an ephemeral port. 7. Write a brief description about the data connection used in FTP. Ans. The data connection uses the well-known port 20 at the server site. However, the creation of adata connection is different from what we have seen so far. The following shows how FTPcreates a data connection:14.The client, not the server, issues a passive open using an ephemeral port. The client mustdo this because it is the client that issues the commands for transferring files.15.The client sends this port number to the server using the PORT command.16.The server receives the port number and issues an active open using the wellknown port20 and the received ephemeral port number.17.After the initial connection, the server process creates a child process and assigns the dutyof serving the client to the child process using an ephemeral port. 8. Write a brief note on the Commands processing. Describe the groups into which Commands(that are sent from client to server) can be divided. Ans. FTP uses the control connection to establish a communication between the client controlprocess and the server control process.

During this communication, the commands are sentfrom the client to the server and the responses are sent back from the server to the client. Commands : We can roughly divide the commands into six groups: access commands, filemanagement commands, data formatting commands, port defining commands, file transferringcommands, and miscellaneous commands. Access commands : These commands let the user access the remote system.Commands are - USER, PASS, ACCT, REIN, QUIT, ABOR File management commands : These commands let the user access the file system on theremote computer. They allow the user to navigate through the directory structure, create newdirectories, delete files, and so on.Commands are CWD, CDUP, DELE, LIST, . Data formatting commands : These commands let the user define the data structure, file typeand transmission mode. The defined format is then used by the file transfer commands.Commands are TYPE, STRU, and MODE. Port defining commands : These commands define the port number for the data connectionon the client site.Commands are PORT, PASV File transfer commands : These commands actually let the user transfer files.RETR, STOR, APPE, STOU, . Miscellaneous commands : These commands deliver information to the FTP user at the clientsite.Commands are - HELP, NOOP, 9. Briefly explain the steps involved in storing an image file into the server from client side. Ans. The steps involved in storing an image file into the server from client side are as follows:18.The control connection to port 21 is created.19.After the control connection to port 21 is created, the FTP server sends the 220 (serviceready) response on the control connection.20.The client sends the USE command (this

USER command passes the user information toserver).21.The server responds with 331 (user name is OK, a password is required).22.The client sends the PASS command (sends the password for the user).23.The server responds with 230 (user login OK, if user id and password match).24.The client issues a passive open on an ephemeral port for data connection and sends thePORT command (over the control connection) to give this port number to the server.25.The server does not open the connection at this time, but prepares itself for issuing anactive open on the data connection between port 20 (server side) and the ephemeral portreceived from the client. It sends the response 150 (data connection will be open shortly).26.The client sends the TYPE command (to indicate the type of data as binary )27.The server responds with response 200 (command OK)28.The client sends the STRU command (defines the data following as of file type.)29.The server responds with response 200 (command OK)30.The client sends the STOR command (to request the server to store the data)31.The server opens the data connection and sends the message 250.32 .Th e c lie n t se n d s th e file o n th e d a ta c o n ne c tion . A fte r th e e n t ire file is se n t t h e d a ta connection is closed. Closing the data connection means end-offile.33.The server sends the response 226 on the control connection.34.The client sends the QUIT command (or it can send the other commands to open another data connection for transferring another file).35.The server responds with 221 (service closing) and it closes the control connection. 1. What is concurrency? Ans: Concurrency means the ability to run simultaneously. Both clients and serves can run inconcurrent mode. However, the concurrency in clients and server differ from each other. Concurrency in Clients: Clients can be run on a computer either iteratively or concurrently. Running clients iterativelymeans running them one by one; one client must start, run, and terminate before the computer can start another client. However today, most computers allow concurrent clients, that is, twoor more clients running at the same time. Concurrency in Servers

Because an iterative server can process only one request at a time, it receives a request,processes it, and sends the response to the requestor before it handles another request. If there is a request from another client, then it has to either reject the request or keep the requestin waiting until the server finishes the first one. On the other hand, a concurrent server canprocess many requests at the same time and thus can share its time between many requests. What are a connectionless iterative server and a connectionless concurrent server? Ans:Connectionless iterative server : The servers that use UDP, a connectionless transport layer protocol, are normally iterative. This means that the server processes one client request at atime in order of their arrival. A server receives the request in a datagram from UDP, processesthe request, and gives the response to UDP to send to the client. Connectionless concurrent server : The servers that use UDP, a connectionless transportlayer protocol can also be iterative. This means that the server processes multiple clientrequests at the same time. This type of server will be found occasionally. 3. What are a connection-oriented iterative server and a connectionoriented concurrent server? Ans:Connection-oriented iterative server : The servers that use TCP, a connection-orientedtransport layer protocol can be concurrent. This means that the server can serve one clientrequest at a time. This type of server will be found occasionally. Connection-oriented concurrent server : The servers that use TCP, a connection-orientedtransport layer protocol, are normally concurrent. This means that the server can serve manyclients at the same time. Communication is connectionoriented, which means that a request isa stream of bytes that can arrive in several segments and the response can occupy severalsegments. A connection is established between the server and each client, and the connectionremains open until the entire stream is processed and the connection is terminated. 4.

What is an active open connection? Ans: A client opens the communication channel using the IP address of the remote host and thewell-known port address of the specific server program running on that machine. This is calledan active open connection. 5. What is a passive open connection? Ans: A server opens the channel for incoming requests from clients, but it never initiates a serviceuntil it is requested to do so. This is called a passive open connection. 6. What is a control connection? Ans: FTP uses ASCII character set to communicate across the control channel. Communication isachieved through commands and responses. This simple method is adequate for the controlconnection because we send one command (response) at a time. Each command or responseis only one short line so we need not worry about file format or file structure. Each line isterminated with a two-character (carriage return and line feed) end-of-line token. 7. What is data connection? Ans: Data connection allows you to transfer files after defining the types of file to be transferred, thestructure of the data, and the transmission mode. Before sending the file through the dataconnection, you need to prepare for transmission through the control connection. Theheterogeneity problem is resolved by defining three attributes of communications: file type, data structure, and transmission mode. A common format for the above three attributes is agreedupon before actually transferring the dataWrite a brief description about client-server model. Ans:

The purpose of a client-server model is to provide data communication services to users. In theclient-server model, an application program, called the client, requests for a service fromanother application program, called the server . In other words, when a machine needs torequest for a service, it is called a requester or a client. When a machine provides a service, itis called a provider or a server. 9. Write a short note on FTP. Ans: File transfer protocol (FTP) is the standard mechanism provided by TCP/IP to copy a file fromone host to another. When two systems use different file name conventions, different ways torepresent text and data, and different directory structures, you can use FTP in such a situationto transfer files. FTP establishes two connections between the hosts. One connection is usedfor data transfer and the other for control information (commands and responses). FTP usestwo wellknown TCP ports, port 20 is used for the data connection and port 21 is used for thecontrol connection. 10. What are the common FTP commands for processing? Ans: FTP uses the control connection to establish a communication between the client controlprocess and the server control process. During this communication, the FTP commands aresent from the client to the server and the responses are sent back from the server to the client.You can divide the FTP commands into six groups: access commands, file managementcommands, data formatting commands, port defining commands, file transferring commands,and miscellaneous commands. Access Commands : These commands let the user access the remote system.Commands are - USER, PASS, ACCT, REIN, QUIT, ABOR File Management Commands: These commands let the user access the file system on theremote computer. They allow the user to navigate through the directory

structure, create newdirectories, delete files, and so on.Commands are CWD, CDUP, DELE, LIST, Data Formatting Commands: These commands let the user define the data structure, file typeand transmission mode. The defined format is then used by the file transfer commands.Commands are TYPE, STRU, and MODE. Port Defining Commands: These commands define the port number for the data connectionon the client site.Commands are PORT, PASV File Transfer Commands: These commands actually let the user transfer files.RETR, STOR, APPE, STOU, Miscellaneous Commands: These commands deliver information to the FTP user at the clientsite.Commands are - HELP, NOOP

Das könnte Ihnen auch gefallen