Next: , Previous: The DV Protocol, Up: Using Verkkoke as Student



3.2 The LS Protocol

The LS protocol uses TCP so that the students get experience with byte stream sockets. The new line character separates different messages. Since TCP provides a reliable byte stream, no additional reliability mechanism is required.

Like with the DV protocol, the student's client first sends an authentication message that identifies the student. If authentication succeeds, the server responds with the message AUTH_OK. Upon successful authentication, the client sends a HELLO message to the server. In a real routing protocol, the HELLO message would be sent through all network interfaces, and thus to all neighbors. Since the simulation server represents the entire virtual network, the client sends the HELLO message only to the simulation server. The server responds with a message for each neighbor of the student's router in the simulated network. The response message has the form HELLO, name, interface, where name is the name of the neighbor that would have sent this response, and interface is the number of the interface through which the message would have arrived, e.g. HELLO, 3, 2. When responses for all neighbors have been sent, the simulation server sends the message NOMORENEIGHBORS, 0.

Next, the client determines the distance to each of its neighbors by sending an ECHO message. The server responds with a message for each neighbor of the form ECHOREPLY, name, distance, where name is the name of the neighbor that would have sent this response, and distance is the distance to that neighbor, e.g. ECHOREPLY, 3, 2.

Now the client has all relevant information about its neighbors. To be able to build its routing table, the client needs information about the rest of the network. In the LS protocol, routers communicate information about their links with INFORM messages. These have the form INFORM, router_name, neighbor_name, distance, where router_name is the name of the router which is sending its link information, and neighbor_name is the name of one of its neighbors, e.g. INFORM, 3, 5, 2. distance is the distance between the two routers. To get link information from the server, the client sends the message INFORM. The server responds by sending INFORM, router_name, neighbor_name, distance messages to the client. After all these messages has been sent, the server closes the TCP connection. At this point, the student's client will have enough information to build a link state database and calculate its routing table using Dijkstra's shortest path algorithm.

If the server receives an invalid protocol message from a client, it responds by sending the message ERROR.