Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

COMP 2133 - Sec. 1 Spring 2018 HW 2 Your second homework focuses on TCP/IP and n

ID: 3699616 • Letter: C

Question

COMP 2133 - Sec. 1 Spring 2018 HW 2 Your second homework focuses on TCP/IP and network programming. Please follow the lectures to write programs using C/C++ 1. (a) A host in an organization has an IP address 150.32.64.34 and a subnet mask 255.255.240.0. What is the address of this subnet? What is the range of IP addresses that a host can have on this subnet? (b) A university has 150 LANs with 100 hosts in each LAN. Suppose the university has one Class B address. Design an appropriate subnet addressing scheme. 2. Using C/C++ and sock programming, write both the client and server programs to implement a task. You can choose the task by yourself (e.g.a chatting application between the server and the client, or a file transfer application between the server and the client, etc.) In the hardcopy, please write clearly what your server program and client programs do. Turn in both the hardcopy and softcopy of your source code, including all cpp Also attach the original plaintext that you find out. Date Due: Thursday, April 12, 2018 and .h files. Your name, your ID number and HW number should be written on the upper-right corner of the top sheet of the hardcopy

Explanation / Answer

1A.

The following mask operation derives the subnet address,

Address : 10010110 00100000 01000000 00100010

Mask : 11111111 11111111 11110000 00000000

Subnet : 10010110 00100000 01000000 00000000

The range of IP addresses that a host can have is as follows,

From : 10010110 00100000 01000000 00000000

To : 10010110 00100000 01001111 11111111

1B.

A Class B address has 14 bits for the network ID and 16 bits for the host ID. To design an appropriate subnet addressing scheme we need to decide how many bits to allocate to the host ID versus the subnet ID. We can choose either 7 bits or 8 bits to identify the hosts. If we allocate 8 bits for to identify the host, as shown below, then there are sufficient subnet-id bits to cover up to 28 =256 LANs and enough host-id bits to cover up to 256 hosts for each LAN. The subnet mask in this case is 255.255.255.0 .

If we allocate 7 bits for to identify the host, as shown below, then there are sufficient subnet-id bits to cover up to 29 =512 LANs and enough host-id bits to cover up to 128 hosts for each LAN. The subnet mask in this case is 255.255.255.128.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote