1,420
19
Report, 2 pages (450 words)

Network programming project report

Project Report 1155028688 Wang Cong Overview This project is a practice of Windows socket programming. In this program we need to complete the following things: 1. Establish a TCP connection to the server. 2. Create a TCP socket listening on a port for the ROBOT program. 3. Create a UDP socket for receiving packets 4. Send and receive messages via TCP sockets 5. Send and receive messages via UDP sockets 6. Compare the throughputs in different buffer sizes. This program is programmed by C++. Program Design I defined the following functions to complete the tasks: void OnError () This function is used to print an error message and call WSACleanup(). It is designed to simplify the clean-up steps when error occurred. * SOCKADDR_IN *CreateSocket (SOCKET &s, u_short port, int type = IPPROTO_TCP, bool isServer = false) This function will create a socket for TCP/UDP connection Parameters: s—-Reference to the socket port—-The port on which to create the connection type—-The connection type(TCP/UDP) isServer—-Set it true to establish a TCP server socket and make it to listen from the port, and false to establish a TCP client socket.

Return: return the SOCKADDR_IN pointer pointed to a SOCKADDR_IN object. NULL if any error occurred, and then the OnError() function will be called * Int sendTCP (SOCKET &s, const char *m) This function will send out a TCP message over the stream socket Parameters: s—-Reference to the socket m—-The message to be sent Return: SOCKET_ERROR if any error occurred. , else return bytes sent. * Int recvTCP (SOCKET &s, char *buffer, int len) This function will receive a TCP message from a stream socket Parameters: s—-Reference to the socket uffer—-The buffer to receive a message len—-The buffer length Return: SOCKET_ERROR if any error occurred or the buffer is a NULL pointer, else return bytes received These functions are designed in order to make the program more clearly. More detail is written in the program. Bonus Part: Testing The Relationship Between Throughput And Buffer Size Figure [ 1 ] Testing On Localhost Figure [ 2 ] Testing On 100M LAN Figure [ 3 ] Testing On 802. 11b Wireless Network We can see the following conclusions from the figures above: 1.

When testing on localhost, the throughput will increase when buffer size increases, and after a particular buffer size, the throughput will decrease 2. When testing on 100M LAN, the throughput will increase and approach the maximum speed(100Mbps) 3. When testing on Wireless Network, the throughput is relatively stable. Because the speed of wireless network is relatively slow. But the throughput is not reaching the highest speed, I think it is because of a higher delay than it was in LAN and localhostenvironment.

Thank's for Your Vote!
Network programming project report. Page 1
Network programming project report. Page 2
Network programming project report. Page 3

This work, titled "Network programming project report" was written and willingly shared by a fellow student. This sample can be utilized as a research and reference resource to aid in the writing of your own work. Any use of the work that does not include an appropriate citation is banned.

If you are the owner of this work and don’t want it to be published on AssignBuster, request its removal.

Request Removal
Cite this Report

References

AssignBuster. (2022) 'Network programming project report'. 4 January.

Reference

AssignBuster. (2022, January 4). Network programming project report. Retrieved from https://assignbuster.com/network-programming-project-report/

References

AssignBuster. 2022. "Network programming project report." January 4, 2022. https://assignbuster.com/network-programming-project-report/.

1. AssignBuster. "Network programming project report." January 4, 2022. https://assignbuster.com/network-programming-project-report/.


Bibliography


AssignBuster. "Network programming project report." January 4, 2022. https://assignbuster.com/network-programming-project-report/.

Work Cited

"Network programming project report." AssignBuster, 4 Jan. 2022, assignbuster.com/network-programming-project-report/.

Get in Touch

Please, let us know if you have any ideas on improving Network programming project report, or our service. We will be happy to hear what you think: [email protected]