www.onlinecode.in Provided By : Online Code

Page | 1

1. (a) Why flow control is used at both Data-Link layer and Transport Layer of OSI model? Also, compare the working of Sliding Window protocol of Data-Link layer and Transport layer.

Solution : Flow Control: When a data frame (Layer-2 data) is sent from one host to another over a single medium, it is required that the sender and receiver should work at the same speed. That is, sender sends at a speed on which the receiver can process and accept the data. What if the speed (hardware/software) of the sender or receiver differs? If sender is sending too fast the receiver may be overloaded, (swamped) and data may be lost. Flow control is a good example of a protocol function that must be implemented in several layers of the OSI architecture model. At the transport level flow control will allow the transport protocol entity in a host to restrict the flow of data over a logical connection from the transport protocol entity in another host. However, one of the services of the network level is to prevent congestion. Thus the network level also uses flow control to restrict the flow of network protocol data units (NPDUs). Thus flow control becomes a much more complex issue at the transport layer than at lower levels like the Data-Link layer. Two reasons for this are: 

Flow control must interact with transport users, transport entities, and the network service.



Long and variable transmission delays between transport entities.

Prepared by : IGNOU ROCK

www.onlinecode.in Provided By : Online Code Two types of mechanisms can be deployed to control the flow: 

Stop and Wait : This flow control mechanism forces the sender after transmitting a data frame to stop and wait until the acknowledgement of the data-frame sent is received.



Page | 2

Sliding Window In this flow control mechanism, both sender and receiver agree on the number of dataframes after which the acknowledgement should be sent. As we learnt, stop and wait flow control mechanism wastes resources, this protocol tries to make use of underlying resources as much as possible.

A sliding window protocol is a feature of packet-based data transmission protocols. Sliding window protocols are used where reliable in-order delivery of packets is required, such as in the Data Link Layer (OSI model) as well as in the Transmission Control Protocol (TCP).

1. (b) Explain the various HTTP request methods using an example of each. Solution : There are two commonly used methods for a request-response between a client and server are: GET and POST.

Prepared by : IGNOU ROCK

www.onlinecode.in Provided By : Online Code

Page | 3

But sometimes more than two HTTP request methods are used on client server based architecture, which are : HEAD - Same as GET, but transfers the status line and header section only. HEAD /hello.htm HTTP/1.1 User-Agent: Mozilla/4.0 (compatible; MSIE5.01; Windows NT) Host: www.onlinecode.in/ Accept-Language: en-us Accept-Encoding: gzip, deflate Connection: Keep-Alive

PUT - Replaces all current representations of the target resource with the uploaded content. PUT /hello.htm HTTP/1.1 User-Agent: Mozilla/4.0 (compatible; MSIE5.01; Windows NT) Host: www.onlinecode.in/ Accept-Language: en-us Connection: Keep-Alive Content-type: text/html Content-Length: 182

DELETE - Removes all current representations of the target resource given by a URI. DELETE /hello.htm HTTP/1.1 User-Agent: Mozilla/4.0 (compatible; MSIE5.01; Windows NT) Host: www.onlinecode.in/ Accept-Language: en-us Connection: Keep-Alive

Prepared by : IGNOU ROCK

www.onlinecode.in Provided By : Online Code

CONNECT - Establishes a tunnel to the server identified by a given URI. CONNECT www.onlinecode.in/ HTTP/1.1 User-Agent: Mozilla/4.0 (compatible; MSIE5.01; Windows NT)

OPTIONS - Describes the communication options for the target resource. OPTIONS * HTTP/1.1

Page | 4

User-Agent: Mozilla/4.0 (compatible; MSIE5.01; Windows NT)

TRACE - Performs a message loop-back test along the path to the target resource. TRACE / HTTP/1.1 Host: www.onlinecode.in/ User-Agent: Mozilla/4.0 (compatible; MSIE5.01; Windows NT)

Note : The all examples, are based only on the client side..

1. (c) How a domain name is mapped to its equivalent network address? Explain using an example. Solution: Domain Mapping is a feature that we can use to point multiple domains to our primary hosting account. We can map domain names to any desired location within our hosting, for example we can map a domain to a blog folder so that the domain goes the blog page. When a Domain name has to be point on any specific IP (network address (Internet Protocol)), then we have to map it’s equivalent network address, so we can point the domain, or simply we can say, Domain Name, line www.onlinecode.in, www.google.com, or some kind of the website domains. As generally, we can say that, the IP addresses are rather difficult to remember (and are not particularly descriptive), the Internet also allows us to specify a computer by a name rather than a number string. For example, the machine at IGNOU with the IP address 18.72.0.3 can also be referred to as : www.onlinecode.in/ Mostly, the Domains are used to short the URL/IP for better experience, with the peoples, who wants to use regularly, the further information’s, which are hosted on the server computer or area.. so it has to be enforcedly mapped the specific Domain on to the Network Address of the server computer.

1. (d) Suppose the class B network uses 20 out of 32 bits to define a network address. How many Class B Network are possible in this case? Not yet solute ??????????????????? keep visiting for updates 2. (a) List and describe all elementary socket systems calls and data transfer calls. Solution: The elementary list of the calls used in socket programming for system calls and data transfer calls. 1. socket() creates an endpoint for communication and returns a descriptor.

Prepared by : IGNOU ROCK

www.onlinecode.in Provided By : Online Code #include #include int socket(int domain, int type, int protocol);

2. accept()used with connection-based socket types (SOCK_STREAM,SOCK_SEQPACKET). #include #include int accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen);

3. bind() gives the socket sockfd the local address my_addr. my_addr is addrlen bytes long. #include #include int bind(int sockfd, const struct sockaddr *my_addr ", socklen_t " addrlen );

4. connect()connects the socket referred to by the file descriptor sockfd to the address specified by serv_addr. #include #include int connect(int sockfd, const struct sockaddr *serv_addr, socklen_t addrlen);

5. fcntl() performs one of the operations described below on the open file descriptor fd. The operation is determined by cmd. #include #include int fcntl(int fd, int cmd); int fcntl(int fd, int cmd, long arg); int fcntl(int fd, int cmd, struct flock *lock);

6. getpeername() returns the name of the peer connected to socket s. #include int getpeername(int s, struct sockaddr *name, socklen_t *namelen);

7. listen() call applies only to sockets of type SOCK_STREAM or SOCK_SEQPACKET. #include int listen(int sockfd, int backlog);

8. read() attempts to read up to count bytes from file descriptor fd into the buffer starting at buf. #include ssize_t read(int fd, void *buf, size_t count);

9. recv() call is normally used only on a connected socket (see connect(2)) and is identical torecvfrom() with a NULL from parameter.

Prepared by : IGNOU ROCK

Page | 5

www.onlinecode.in Provided By : Online Code #include #include ssize_t recv(int s, void *buf, size_t len, int flags); ssize_t recvfrom(int s, void *buf, size_t len, int flags, struct sockaddr *from, socklen_t *fromlen); ssize_t recvmsg(int s, struct msghdr *msg, int flags);

10. send() call may be used only when the socket is in a connected state (so that the intended recipient is known). #include #include ssize_t send(int s, const void *buf, size_t len, int flags); ssize_t sendto(int s, const void *buf, size_t len, int flags, const struct sockaddr *to, socklen_t tolen); ssize_t sendmsg(int s, const struct msghdr *msg, int flags);

11. select() and pselect() allow a program to monitor multiple file descriptors, waiting until one or more of the file descriptors become "ready" for some class of I/O operation 12. write() writes up to count bytes to the file referenced by the file descriptor fd from the buffer starting at buf. #include ssize_t write(int fd, const void *buf, size_t count);

13. shutdown() call causes all or part of a full-duplex connection on the socket associated withs to be shut down. #include int shutdown(int s, int how);

2. (b) Write a connection-oriented client and server algorithm (using socket system calls) where client program interact with the Server as given below:

 

A client machine begins by sending a request to calculate a factorial of a number; the server sends back a confirmation of the service (if server is having any method for calculating factorial) to the respective client. If Server confirmation is positive, client sends a number and server replies as the factorial of that number to the client.

Solution: The Solution of this particular questions, will be updated soon, please keep visiting IGNOU ROCK and WWW.ONLINECODE.IN http://ignourock.webs.com/ http://www.onlinecode.in/

3. (a) Compare the security features, reliability approaches and delivery mechanisms of IPv4 and IPv6. Solution: Here are some of the major differences between IPv4 and IPv6. Both standards are extensive and many features are less obvious and important for only some environments.

Prepared by : IGNOU ROCK

Page | 6

www.onlinecode.in Provided By : Online Code

IPv4/IPv6 Differences IPv4 Address

32 bits (4 bytes) 12:34:56:78

IPv6 128 bits (16 bytes) 1234:5678:9abc:def0: 1234:5678:9abc:def0

Packet size

576 bytes required, fragmentation optional

1280 bytes required without fragmentation

Packet fragmentation

Routers and sending hosts

Sending hosts only

Packet header

Does not identify packet flow for QoS handling

Contains Flow Label field that specifies packet flow for QoS handling

Includes a checksum

Does not include a checksum

Includes options up to 40 bytes

Extension headers used for optional data

Address (A) records, maps host names

Address (AAAA) records, maps host names

Pointer (PTR) records, IN-ADDR.ARPA DNS domain

Pointer (PTR) records, IP6.ARPA DNS domain

Manual or via DHCP

Stateless address autoconfiguration (SLAAC) using Internet Control Message Protocol version 6 (ICMPv6) or DHCPv6

DNS records

Address configuration

IP to MAC resolution broadcast ARP

Multicast Neighbor Solicitation

Local subnet group management

Internet Group Management Protocol (IGMP)

Multicast Listener Discovery (MLD)

Broadcast

Yes

No

Multicast

Yes

Yes

IPSec

optional, external

required

(b) Compare the security features, reliability approaches and delivery mechanisms of IPv4 and IPv6.

Solution The computers in a LAN are separated by a short distance (typically < 100m) so high speed and reliable communication is possible using a shared broadcast medium. The cost of the medium is negligible and the overall cost is dominated by the cost of the network interface cards in each computer. In addition, the LAN users usually belong to the same group where all users are generally trusted, so broadcast does not pose much security danger. The original reason for avoiding a multiplexer and switch approach to LANs is that a centralized, expensive “box” is required. The availability of Application Specific

Prepared by : IGNOU ROCK

Page | 7

www.onlinecode.in Provided By : Online Code Integrated Circuits (ASICs) has reduced the cost of switching boxes and made switch based LANs feasible, and in some environments the dominant approach. (c) Identify the Address Class of the following IP addresses: o 255.255.190.0 o 216.111.52.12 Page | 8 o 150.156.10.10 o 92.2.1.1 Solution (a). 00 As we know the IP Address are divide into 4 parts, i.e- mmm.nnn.ooo.ppp The first (mmm) part is called first octet of the ip address, and 2nd (nnn) part is called second octet, 3rd (ooo) is called third octet, and last 4th (ppp) part is called fourth octet of the further IP Addresses. We, can identify the class of any specific IP with the help of only first octet of the IP Address, which range should be :

IP Address Classes Class Class Class Class Class Class

Name A Range B Range C Range D Range E Range

First Octet Range 0 to 127 128 to 191 192 to 223 224 to 239 240 to 255

Hierarchical IP Addressing Scheme 8 bits 8 bits Class A Network Host Class B Network Network Class C Network Network Class D Multicast Class E Research

8 bits Host Host Network

8 bits Host Host Host

Here, we can see the different ranges show the different classes, so if we put out IP address in this format, then we can get this answer easily. (a) (b) (c) (d)

255.255.190.0 216.111.52.12 150.156.10.10 92.2.1.1

(Class (Class (Class (Class

E) C) B) A)

(d) Why would an application use UDP instead of TCP? Also, explain how can TCP handle urgent data? Solution : The User Datagram Protocol (UDP) is a transport layer protocol for use with the IP network layer protocol. It provides a best-effort datagram service to an end system (IP host). UDP provides no guarantee for delivery and no protection from duplication, but the simplicity of UDP reduces overhead from the protocol and can be adequate for some applications.

A computer may send UDP packets without first establishing a connection to a recipient. The computer completes the appropriate fields in the UDP header (PCI) and

Prepared by : IGNOU ROCK

www.onlinecode.in Provided By : Online Code forwards the data together with the header for transmission by the IP network layer.

Typically, use UDP in applications where speed is more critical than reliability. For example, it may be better to use UDP in an application sending data from a fast acquisition where it is acceptable to lose some data points. You can also use UDP to broadcast to any machine(s) listening to the server. In general:  TCP is for high-reliability data transmissions  UDP is for low-overhead transmissions How TCP handle urgent data: When an interactive hits the DEL or CTRL-C key to break-off a remote computation that has already begun, the sending application puts some control information in the data stream and gives it to TCP along with the URGENT flag. This even causes TCP to stop accumulating data and transmit everything it has for that connection immediately. The receiving application is interrupted so it can stop whatever it was doing so that it can read the data stream to find the urgent data.

4. (a) Assume you are chief network administrator of a company. This company is having its offices in different cities. Each office is having more than 50 machines and a server. These servers and network of all offices are further controlled and managed by the main server. Discuss the security issues and threats in such network. Make a chart to explain the available solutions for each issue/threat. Solution :

Like if we are talking about the WAN network, means the same networks connected through any medium (wired or wireless) we have to notice one thing specially, that, whenever the attackers, are assume the catalogue on the networks, they want to know about the security questions.. for the hacking process, or something like that… Here we should make a sense on it, that if we have the WAN network, around the different cities, then we will defiantly make the assumption for them, like they have securely appointed the firewall on every single computers, in the whole network. Whether offering Internet access to patrons or providing an online catalogue, steps must be taken to implement effective network security to protect our resources. With a proper technology plan in place, you should have already addressed many of the issues surrounding network security. Our purpose here is to provide insight for the particular issues regarding network security, including:  Understanding networking concepts  Identifying vulnerabilities on our network  Creating security policies and selecting and configuring a firewall Importance : 





The good neighbor policy. Our mistakes can be someone else’s headaches. If our network is insecure and someone takes control of one of our computers, they can use that machine to launch denial of service attacks on innocent third parties. They can also flood the Web with spam. Patron privacy. Obviously, patron records are of paramount importance. Trust between the library and its clients can be irreparably harmed if these records are compromised. Money and time. Tracking down a virus or a worm and eliminating it from our network is frustrating and time-consuming. You often have to rebuild our machines from the ground up, reinstalling the operating system and software

Prepared by : IGNOU ROCK

Page | 9

www.onlinecode.in Provided By : Online Code and restoring data from backup tapes. Lax security can lead to weeks of wasted time spent patching our network and fixing the wreckage.

Actions, what we can take on it: Create a network diagram. One of the most useful exercises for understanding our Page | library’s security situation is creating a network diagram. A network diagram consists of symbols representing our hardware (PCs, servers, switches, routers, printers, etc.) 10 and the connections between them. The diagram should also include some information about the model and configuration of each piece of hardware (e.g., name, IP address, function, etc.). For network connections, list the speed and protocol of each link. Understand our situation. A network diagram goes hand-in-hand with an assessment and evaluation of everything that happens on our network. Who uses our network? What types of hardware and software do they use? What kind of Internet connection does our library have? Do we host our own Web site, our own email server, our own OPAC? Do we allow patrons to connect to our network with their own computers and peripheral devices? Is our staff network separated from the public network? What types of security policies, procedures and equipment do we already have in place? Review your technology plan. Review this document, if available, to determine the network services you’re currently providing and the plans for your network’s future. Train your IT staff or hire a consultant. We must make sure that either our IT staff receive appropriate training when it comes to network security or look for outside IT support that can offer the necessary knowledge to secure our network. Remember the 80/20 rule. Focus on protecting the high-impact, high-risk areas of our network.

(b) Describe the activities to be performed at every layer in the TCP/IP model when information flows from layer to another layer.

Solution :

The Link Layer The link layer is the lowest layer of the TCP/IP model; it is also referred to in some texts as the network interface layer. The link layer combines the physical and data link layer functions into a single layer. This includes frame physical network functions like modulation, line coding and bit synchronization, frame synchronization and error

Prepared by : IGNOU ROCK

www.onlinecode.in Provided By : Online Code detection, and LLC and MAC sub-layer functions. Common protocols include the Address Resolution Protocol (ARP), Neighbor Discovery Protocol (NDP), IEEE 802.3 and IEEE 802.11. The Internet Layer The Internet layer is the next layer up from the link layer and is associated with the network layer of the OSI model. Functions include traffic routing, traffic control, Page | fragmentation, and logical addressing. Common protocols include IP, ICMP and IGMP. 11 The Transport Layer The Transport layer is the next layer and is typically related directly with the same named layer in the OSI model. Functions include message segmentation, acknowledgement, traffic control, session multiplexing, error detection and correction (resends), and message reordering. Common protocols include the Transport Control Protocol (TCP) and User Datagram Protocol (UDP). The Application Layer The Application layer is the highest layer in the TCP/IP model and is related to the session, presentation and application layers of the OSI model. The application layer of the TCP/IP model is used to handle all process-to-process communication functions; these functions were carried out by multiple different layers when referencing the OSI model. There are a number of different functions which are carried out by this layer, including session establishment, maintenance and termination, character code translations, data conversion, compression and encryption, remote access, network management and electronic messaging to name a few. Common protocols include Named Pipes, NetBIOS, MIME, TLS, SSL, FTP, DNS, HTTP, SMTP and many others. (c) The size of the option field of an IP diagram is 20 bytes. What is the value of HLEN field in binary?

Solution : HLEN defines the total length of the datagram header in 4-byte words. The length of the header varies between 20 and 60 bytes. When the header length is 20 bytes, then value of HLEN is 5 (5*4 = 20). In binary form: (20)10 = (00010100)2 (d) Write short notes on following: a. ICMP. b. IP Encapsulation c. Sockets. d. SNMP. Solution:

Prepared by : IGNOU ROCK

www.onlinecode.in Provided By : Online Code

Page | 12

Prepared by : IGNOU ROCK

BCS-052.pdf

Flow Control: When a data frame (Layer-2 data) is sent from one host to another. over a single medium, it is required that the sender and receiver should work at ...

753KB Sizes 2 Downloads 173 Views

Recommend Documents

No documents