$25
The objective of this programming project is to implement a software router which can route data packets from source client to destination host machine. This will help students to understand router to router interaction using UDP socket interface in C programming language. After completing the project, students will have an intermediate understanding of the adapted next-hop routing protocol and steps require for developing a networking application to route data packets to destination node.
2. Project Specification:
2.1. Overall System Behavior:
You are required to implement an adapted next-hop routing protocol which will route the client packet(s) to a destination node. The following figure shows high-level overall system requirements.
In this project, you are required to write four programs, source client, server, router, and destination client. Client and server programs are very close to earlier projects where you had to implement user authentication using TCP connection and send data packets from clients to another node using UDP socket. The router program is new in which it will route the data packet received from client to proper destination based on neighbor list text file. Detail description of the client, server, and the router program along with input formats are specified below.
2.2. Input Format:
Client, Server, and Router must be command-line tools that allow transmitting messages and supports the following parameters:
SourceClient <clientPort <serverIP <serverPort <routerIP <routerPort <destClientName
Server <server_port
Router <routerPort <neighborRouterIP <neighborRouterPort <neighborClientList_File DestinationClient <clientPort <routerIP <routerPort
2.3. Client Behavior:
• Your source client program takes six arguments from user during startup that specifies the port number of the client program, IP address and port number of the authentication server, IP address and port number of the neighbor router it will be associated with, and name of the destination host machine (e.g., gpel8.cs.ou.edu) where it wants to send the message (string).
• You have to use (4000+last 4 digits of your student-id number) to avoid requesting same port by multiple students. Incrementally use the client port number +1 for the next client to avoid duplication.
• After a successful startup, client program will print a welcome message and ask the user to input username and password for login into the server. You need to create TCP connection between client and server program. The authentication process and error handling is same as earlier project(s). If login fails, the client will send another pair of username and password to server. Your program should handle all input errors.
• After successful login, your client program will send the destination client name (e.g., gpel8.cs.ou.edu) to retrieve the IP and port number of the machine. If the name doesn’t match, the server program will send appropriate negative message to resend a valid name.
• After retrieving IP and port from the server, your client program will prompt user to input a message that will be send to the destination client machine through router.
• Your source client program will send the message to the neighbor router (the IP and port number of the router is taken as arguments during startup) using UDP packet. If the packet is sent to a wrong neighbor router, the router will drop the message and send an error message back to client.
• If the message is properly sent to the destination client machine, the neighbor router will send a message along with the IP and Port of the router who has delivered the message back to the source client program. You need to print these messages into the output.
• Similarly, if the message is lost for any reason, an error message is sent back to the client which needs to be printed into the output.
• Finally, the source client program will go back and prompt whether the user wants to send another message.
• Your destination client program takes three arguments from user during startup that specifies the port number of the client program, IP address and port number of the neighbor router it will be associated with.
• After startup, destination client program will wait for an incoming UDP packet containing the source client message. Destination client program will accept UDP packet only from the associated route which is given during the startup. If a received packet source is different, then it should drop the packet and send a negative message.
• If packet arrives from a valid source, then it will print the message along with the IP addresses and port numbers of all the routers the packet has passed on the way as a list. After printing the complete trace of route, it should go back and wait for another packet.
2.4. Server Behavior:
• At startup, the server takes only one argument that specifies the port number that it is listening to. You have to use (5000+last 4 digits of your student-id number) to avoid requesting same port by multiple students.
• After successful startup, the server program will wait for a TCP client interaction for user authentication. Server has usersList.txt file which contains username and password separated by a blank space. If authentication fails, server sends negative feedback and client will provide new pair of data for login.
• If authentication is successful, then server will wait for a destination host name (e.g., gpel8.cs.ou.edu) from client. Server will use this name and search the destinationClient.txt file to retrieve the IP and Port number of the destination client machine. Server will send back a negative message if name doesn’t match else it will send the IP and Port of the destination client machine back to the client program.
• You need to print relevant messages into the output after sending/receiving data so that we can see your processes are working correctly or not.
• After serving one client, the server program should go back and wait for a next client request.
2.5. Router Behavior:
• At startup, the router program takes four arguments that specify the port number that it is listening to, IP address and Port number of the neighbor router it’s associated with (a router has only one neighbor router), and a text file containing neighbor clients list.
• You have to use (6000+last 4 digits of your student-id number) to avoid requesting same port by multiple students. Incrementally use the router port number +1 for the next router to avoid duplication.
• After startup, router will send a packet to its neighbor router to inform that it is the source router. Next, router will wait for incoming UDP packets (containing a message) to be transmitted from the source client machine to a destination client machine. Router verifies whether the source client is in the neighbor client list text file or not. Only neighbor clients are allowed to use their router.
• If the client has permission (in the neighbor list) to use this router, then router will accept the UDP packet and extract the destination host machine IP and port from the packet. This information will be used to check whether the destination host is in the same neighbor client list of the router. If a match is found, the router will send the packet to the destination host.
• If the destination host is not in the client list, then the packet will be sent to the next neighbor router for delivery. Note: each router has only one neighbor router associated with it. If a packet comes from a different source, the router should drop it and inform that the client/router doesn’t have permission to use this router.
• The packet will propagate through the network until it’s delivered, or it has passed all the routers to avoid looping. After passing all the routes, if the packet can’t be delivered, router which is currently holding the packet will drop it and inform the source client that the destination host doesn’t exists.
• After receiving a message (either from source client or router), your router program should print the message along with message source (IP & Port). Similarly, after routing the message to another router or destination, your router program should print the message delivery information (IP & Port) of the node.
• Your router program should handle all input/output errors. After routing a packet to next router or destination client machine, your router program should go back and wait for another UDP packet to route.