npns answer key 2.1

38
NPNS_Supplement_2 Best of Luck!!!

Upload: neeraj-singh

Post on 16-Oct-2014

174 views

Category:

Documents


1 download

DESCRIPTION

the strudy notes on computer networks based on the previous year question papers.

TRANSCRIPT

Page 1: NPNS Answer Key 2.1

NPNS_Supplement_2

Best of Luck!!!

Page 2: NPNS Answer Key 2.1
Page 3: NPNS Answer Key 2.1
Page 4: NPNS Answer Key 2.1
Page 5: NPNS Answer Key 2.1
Page 6: NPNS Answer Key 2.1
Page 7: NPNS Answer Key 2.1
Page 8: NPNS Answer Key 2.1
Page 9: NPNS Answer Key 2.1

Exam Question

• Explain the procedure for mapping multicast address to Ethernet address:

• http://www.tcpipguide.com/free/t_TCPIPAddressResolutionForIPMulticastAddresses.htm

Page 10: NPNS Answer Key 2.1

• IP multicast addresses are resolved to IEEE 802 (Ethernet) MAC addresses using a direct mapping technique that uses 23 of the 28 bits in the IP multicast group address.

Page 11: NPNS Answer Key 2.1
Page 12: NPNS Answer Key 2.1
Page 13: NPNS Answer Key 2.1

6

Page 14: NPNS Answer Key 2.1

• Linux IP firewall utility called iptables.• An iptables firewall consists of several tables, each

with a default policy and builtin chains of rules. Further rule chains can optionally be created in each table. Different tables and chains are traversed according to the source and destination of the packet.

• IPTables is a statefulfirewall.• The iptables command is used to configure both IP

filtering and Network Address Translation.

Page 15: NPNS Answer Key 2.1
Page 16: NPNS Answer Key 2.1
Page 17: NPNS Answer Key 2.1
Page 18: NPNS Answer Key 2.1
Page 19: NPNS Answer Key 2.1

• What is DHCP?• The Internet is a vast source of information that is continuously updated and

accessed via computers and other devices. For a device (also referred to as a host) to connect to the Internet, it is necessary that among other configurations, it must have an Internet Protocol (IP) address. The IP address is the computer's address on the Internet. A common comparison of an IP address is an individual's telephone number, which is an identifier for people to communicate with the individual. Up until the late 1980s, configuring a computer to connect to the Internet was a manual process. The protocol Bootstrap Protocol (BOOTP) was the first Transmission Control Protocol/Internet Protocol (TCP/IP) network configuration tool used to prevent the task of having to manually assign IP addresses by automating the process.

• While the introduction of the BOOTP network protocol was a welcome innovation for network administrators tasked with managing large numbers of computers on a network, it was the first attempt and a new and improved TCP/IP network protocol soon followed. This protocol is called Dynamic Host Configuration Protocol (DHCP). DHCP was not designed as a replacement for BOOTP, but an extension of its functionality.

Page 20: NPNS Answer Key 2.1

How DHCP WorksAs its name indicates, DHCP provides dynamic IP address assignment. What this means is that instead of having to rely on a specific IP address, a computer will be assigned one that is available from a subnet or "pool" that is assigned to the network. DHCP also extends BOOTP functionality to provide IP addresses that expire. BOOTP indirectly uses a form of leasing that never expired, but the term wasn't actually used until the introduction of DHCP. When DHCP assigns an IP address, it actually leases the identifier to the host computer for a specific amount of time. The default lease is five days, but a network administrator should evaluate their own particular circumstances to determine an appropriate lease.

Page 21: NPNS Answer Key 2.1
Page 22: NPNS Answer Key 2.1

• Extension Headers• In IPv6, extension headers are used to encode optional Internet-

layer information.• Extension headers are placed between the IPv6 header and the

upper layer header in a packet.• Extension headers are chained together using the next header

field in the IPv6 header. The next header field indicates to the router which extension header to expect next. If there are no more extension headers, the next header field indicates the upper layer header (TCP header, User Datagram Protocol [UDP] header, ICMPv6 header, an encapsulated IP packet, or other items).

• http://www.juniper.net/techpubs/en_US/junos9.6/information-products/topic-collections/config-guide-routing/id-10122335.html

Page 23: NPNS Answer Key 2.1
Page 24: NPNS Answer Key 2.1

• register_netdev(snull_devs);• unregister_netdev(dev);

Page 25: NPNS Answer Key 2.1

Architecture

Network stack

Network hardware driver

Bus infrastructure(platform, pci, usb, etc.)

sk_buff net_device

Page 26: NPNS Answer Key 2.1

sk_buff

The struct sk_buff is the structure representing a network packet

Designed to easily support encapsulation/decapsulation of data through the protocol layers

In addition to the data itself, an sk_buff maintains

head, the start of the packet

data, the start of the packet payload

tail, the end of the packet payload

end, the end of the packet

len, the amount of data of the packet

These fields are updated when the packet goes through the protocol layers

Page 27: NPNS Answer Key 2.1

struct net_device

This structure represents a single network interface

Allocation takes place with alloc_etherdev()

The size of private data must be passed as argument. The pointer to these private data can be read in net_device->priv

alloc_etherdev() is a specialization of alloc_netdev() for Ethernet interfaces

Registration with register_netdev()

Unregistration with unregister_netdev()

Liberation with free_netdev()

Page 28: NPNS Answer Key 2.1
Page 29: NPNS Answer Key 2.1
Page 30: NPNS Answer Key 2.1

• Windows Sockets server applications generally create a socket, and then use the listen() function on it to listen for connection requests. One of the parameters passed when calling listen() is the backlog of connection requests that the application would like Windows Sockets to queue for it. This value controls the number of unaccepted connections that can be queued. Once an application accepts a connection, it is moved out of the connection request backlog and no longer counts. The Windows Sockets 1.1 specification indicates that the maximum allowable value for a backlog is 5; however, Windows NT 3.51 accepts a backlog of up to 100, Windows NT 4.0 and Windows 2000 Server accept a backlog of 200, and Windows NT 4.0 Workstation and Windows 2000 Professional accept a backlog of 5 (which reduces memory demands).

Page 31: NPNS Answer Key 2.1

The listen function• Description

– The listen function converts a data socket into a listening socket. In this manual, the term data socket means a socket that you can use to send and receive data, and the term listening socket means a socket that you can use to listen for attempts by other sockets to connect. When you first create a socket it is a data socket by default.

• Declaration– The system include file WinSock2.inc contains the following declaration for

the listen function:– function listen(s : SOCKET; backlog : integer) : integer; external dll='ws2_32.dll';

• The Second Argument• The second argument passed to the listen function is the maximum length of the

queue of pending connections. If you pass a value, for this argument, that is too large then the underlying service provider will choose an appropriate value. If you are not sure what value you should use for this argument then use SOMAXCONN, which will cause the underlying service provider to choose an appropriate value. NOTE: The constantSOMAXCONN is declared in the system include file WinSock2.inc.

Page 32: NPNS Answer Key 2.1

CS 640 32

IP V6:Address Space and Notation• Allocation is classless

– Prefixes specify different uses (unicast, multicast, anycast)• Anycast: send packets to nearest member of a group

– Prefixes can be used to map v4 to v6 space and visa-versa– Lots of flexibility with 128 bits!

• ~1500 address/sqft of the earths surface• Standard representation is set of eight 16-bit values separated by

colons– Eg. 47CD:1234:3200:0000:0000:4325:B792:0428– If there are large number of zeros, they can be omitted with series of

colons• Eg. 47CD:1234:3200::4325:B792:0428

– Address prefixes (slash notation) are the same as v4• Eg. FEDC:BA98:7600::/40 describes a 40 bit prefix

Page 33: NPNS Answer Key 2.1

Misc…

Page 34: NPNS Answer Key 2.1
Page 35: NPNS Answer Key 2.1
Page 36: NPNS Answer Key 2.1
Page 37: NPNS Answer Key 2.1
Page 38: NPNS Answer Key 2.1