Computer Network Lab Viva Questions What is meant by Router ? A router is an electronic device that interconnects two ormore computer networks, and selectively interchangespackets of data between them . A router is a networkingdevice whose software and hardware are customized to thetasks of routing and forwarding information . What is meant by Hubs ? A common connection point for devices in a network. Hubs are commonly used to connect segments of a LAN. A hubcontains multiple ports. When a packet arrives at one port, itis copied to the other ports so that all segments of the LANcan see all packets. What is meant by Bridges ? A network bridge connects multiple network segments at the data link layer (layer 2) of the OSI model . What do u mean by NIC (Network Interface Card) ? A network card, network adapter, or NIC (network interfacecard) is a piece of computer hardware designed to allowcomputers to communicate over a computer network. Itprovides physical access to a networking medium and oftenprovides a low-level addressing system through the use of MAC addresses. What do u mean by Repeater ? A repeater is an electronic device that receives a signal, cleans it of unnecessary noise, regenerates it, andretransmitsit at a higher power level, or to the other side of anobstruction, so that the signal can cover longer distanceswithout degradation. Definitions of Firewall ? Firewalls are the most important aspect of the networkand its security in today's era. Due to maximization of attackson the networks from various groups stealing data, denyingservices etc the firewall is playing a vital roles in computernetworks. What is the Difference between HUB and SWITCH ? HUB-it is a network device that provide a centralconnection on for cables from work station , server etc.the hubtake incoming single one port and provide every port so thatis main reason for collision.switch.it also provide central connection to the work station.itprovide the unique cast.it is better than a hub.HUB HUb (1)work on physical layer in osi model(2) Hub is half dupllex(3) collision detection is on in hub(4) Hub broadcast of transmitted message.Switch (1) switch work in data link layer in osi model(2) switch work half and full duplex(3) collision detection is off (4) switch transmitted messagee unicast and some timebroadcast. Difference between Physical Address andLogical Address ? A Physical address is a 48-bit flat address burned into theROM of the NIC card which is a Layer1 device of the OSImodel. This iis divided into 24-bit vendor code and 24-bitserial address. This is unique for each system and cannot be changed.A Logical address is a 32- bit address assigned to each systemin a network. This works in Layer-3 of OSI Model. This would be generally the IP address. What is MAC Address ? A unique48 Bit address assigned to each network card. Itsalso called as physical address. What is PING Utility ? PING stands Packet Internet Gopher. This is a utility for ensuring connectivity between computers . ICMP protocol works behind this utility. Under it , sending node sends packets to destination node and reply is received if there is proper communication between two.Ping command use to check the Destination host or router connetivity to use the icmp and echo packet. What do u mean by Gateway ? They relay packets among networks that have different protocols (e.g. between a LAN and a WAN). They accept a packet formatted for one protocol and convert it to a packet formatted for another protocol before forwarding it. They operate in all seven layers of the OSI model. What are the different type of networking / internetworking devices? 1. Repeater: Also called a regenerator, it is an electronic device that operates only at physical layer. It receives the signal in the network before it becomes weak, regenerates the original bit pattern and puts the refreshed copy back in to the link. 2. Bridges: These operate both in the physical and data link layers of LANs of same type. They divide a larger network in to smaller segments. They contain logic that allow them to keep the traffic for each segment separate and thus are repeaters that relay a frame only the side of the segment containing the intended recipent and control congestion.
3. Routers: They relay packets among multiple interconnected networks (i.e. LANs of different type). They operate in the physical, data link and network layers. They contain software that enable them to determine which of the several possible paths is the best for a particular transmission. 4. Gateways: They relay packets among networks that have different protocols (e.g. between a LAN and a WAN). They accept a packet formatted for one protocol and convert it to a packet formatted for another protocol before forwarding it. They operate in all seven layers of the OSI model. What is ICMP? ICMP is Internet Control Message Protocol, a network layer protocol of the TCP/IP suite used by hosts and gateways to send notification of datagram problems back to the sender. It uses the echo test / reply to test whether a destination is reachable and responding. It also handles both control and error messages. What are the data units at different layers of the TCP / IP protocol suite? The data unit created at the application layer is called a message, at the transport layer the data unit created is called either a segment or an user datagram, at the network layer the data unit created is called the datagram, at the data link layer the datagram is encapsulated in to a frame and finally transmitted as signals along the transmission media. What is difference between ARP and RARP? The address resolution protocol (ARP) is used to associate the 32 bit IP address with the 48 bit physical address, used by a host or a router to find the physical address of another host on its network by sending a ARP query packet that includes the IP address of the receiver. The reverse address resolution protocol (RARP) allows a host to discover its Internet address when it knows only its physical address. What is the minimum and maximum length of the header in the TCP segment and IP datagram? The header should have a minimum length of 20 bytes and can have a maximum length of 60 bytes. What is the range of addresses in the classes of internet addresses? Class A 0.0.0.0 - 127.255.255.255 Class B - 128.0.0.0 - 191.255.255.255 Class C - 192.0.0.0 - 223.255.255.255 Class D - 224.0.0.0 - 239.255.255.255 Class E - 240.0.0.0 - 247.255.255.255 What is traffic shaping? One of the main causes of congestion is that traffic is often busy. If hosts could be made to transmit at a uniform rate, congestion would be less common. Another open loop method to help manage congestion is forcing the packet to be transmitted at a more predictable rate. This is called traffic shaping. What is multicast routing? Sending a message to a group is called multicasting, and its routing algorithm is called multicast routing. What is region? When hierarchical routing is used, the routers are divided into what we will call regions, with each router knowing all the details about how to route packets to destinations within its own region, but knowing nothing about the internal structure of other regions. What is silly window syndrome? It is a problem that can ruin TCP performance. This problem occurs when data are passed to the sending TCP entity in large blocks, but an interactive application on the receiving side reads 1 byte at a time. What is IGP (Interior Gateway Protocol)? It is any routing protocol used within an autonomous system. What is EGP (Exterior Gateway Protocol)? It is the protocol the routers in neighboring autonomous systems use to identify the set of networks that can be reached within or via each autonomous system.
What is autonomous system? It is a collection of routers under the control of a single administrative authority and that uses a common Interior Gateway Protocol. What is BGP (Border Gateway Protocol)? It is a protocol used to advertise the set of networks that can be reached with in an autonomous system. BGP enables this information to be shared with the autonomous system. This is newer than EGP (Exterior Gateway Protocol). What Is The Difference Between TCP And UDP? o TCP and UDP are both transport-level protocols. TCP is designed to provide reliable communication across a variety of reliable and unreliable networks and internets. o UDP provides a connectionless service for application-level procedures. Thus, UDP is basically an unreliable service; delivery and duplicate protection are not guareented. What Does A Socket Consists Of? The combination of an IP address and a port number is called a socket. Explain Connection Establishment By Server - Accept()? int accept(int sockfd, struct sockaddr *name,int *namelen) The accept() call establishes a client-server connection on the server side. (The client requests the connection using the connect() system call.) The server must have created the socket using socket(), given the socket a name using bind(), and established a listen queue using listen(). What This Function Recvfrom() Does? int recvfrom(int s, char *msg, int len, int flags,struct sockaddr *from, int *fromlen) This function allows a message msg of maximum length len to be read from a socket with descriptor s from the socket named by from and fromlen, where fromlen is the actual length of from. The number of characters actually read from the socket is the return value of the function. On error, -1 is returned and errno describes the error. flags may be 0, or may specify MSG_PEEK to examine a message without actually receiving it from the queue. If no message is available to be read, the process will suspend waiting for one unless the socket is set to nonblocking mode (via an ioctl call). The system I/O call read() can also be used to read data from a socket. What This Function Sendto() Does? int sendto(int s, char *msg, int len, int flags, struct sockaddr *to, int tolen) This function allows a message msg of length len to be sent on a socket with descriptor s to the socket named by to and tolen, where tolen is the actual length of to. flags will always be zero for our purposes. The number of characters sent is the return value of the function. On error, -1 is returned and errno describes the error. What This Function Bind() Does? int bind(int s, struct sockaddr *name, int namelen) Recall that, using socketpair(), sockets could only be shared between parent and child processes or children of the same parent. With a name attached to the socket, any process on the system can describe (and use) it. In a call to bind(), s is the file descriptor for the socket, obtained from the call to socket(). name is a pointer to a structure of type sockaddr. If the address family is AF_UNIX (as specified when the socket is created), the structure is defined as follows: struct sockaddr {
u_short sa_family; char sa_data[14]; }; name.sa_family should be AF_UNIX. name.sa_data should contain up to 14 bytes of a file name which will be assigned to the socket. namelen gives the actual length of name, that is, the length of the initialized contents of the data structure. A value of 0 is return on success. On failure, -1 is returned with errno describing the error. Explain Data Transfer Over Connected Sockets - Send() And Recv()? Two additional data transfer library calls, namely send() and recv(), are available if the sockets are connected. They correspond very closely to the read() and write() functions used for I/O on ordinary file descriptors. int send(int sd, char *buf, int len, int flags) int recv(int sd, char * buf, int len, int flags) In both cases, sd is the socket descriptor. For send(), buf points to a buffer containing the data to be sent, len is the length of the data and flags will usually be 0. The return value is the number of bytes sent if successful. If not successful, -1 is returned and errno describes the error. For recv(), buf points to a data area into which the received data is copied, len is the size of this data area in bytes, and flags is usually either 0 or set to MSG_PEEK if the received data is to be retained in the system after it is received. The return value is the number of bytes received if successful. If not successful, -1 is returned and errno describes the error.
What is the difference between read() and recv()? read() is equivalent to recv() with a flags parameter of 0. Other values for the flags parameter change the behaviour of recv(). What is the difference between Write() and Send()? write() is equivalent to send() with flags == 0. How to use select call for multiplexing. Ans: First declare fd_set variables. so that this can be used in select call. Depending on the (read/write) on socket you are using Add the socket to the corresponding fd_sets using FD_SET() call. Before that you have to clear any garbage value there using FD_ZERO(). Then Select call requires timeout ie. maximum time to wait for I/O arrival on fds. We are going to wait indefinetly so we make the timeval structure ZERO by making any calls specified in the comments. Call the select call with First Argument as 1 greater than the greater numbered file descriptor in the second , third or fourth argument. since we are going to read the socket place it in the second argument fd_set (as already we done). and give the timeval structure as Last argument to select so select will wait indefinetly on the socket and if any I/O comes it will return with success value. Then check for the Existence of the socket descriptor in the readfds fd_set using FD_ISSET() macro. if it returns true then we can continue any further reading with that socket. Whats the difference between select() and poll()? The basic difference is that select()'s fd_set is a bit mask and therefore has some fixed size. It would be possible for the kernel to not limit this size when the kernel is compiled, allowing the application to define FD_SETSIZE to whatever it wants (as the comments in the system header imply today) but it takes more work. With poll(), however, the user must allocate an array of pollfd structures, and pass the number of entries in this array, so there's no fundamental limit. As Casper notes, fewer systems have poll() than select, so the latter is more portable. Also, with original implementations (SVR3) you could not set the descriptor to -1 to tell the kernel to ignore an entry in the pollfd structure, which made it hard to remove entries from the array.