PROJECT 5: L2TP ================ 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |T|L|x|x|S|x|O|x|x|x|x|x| Ver | Length (opt) | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Tunnel ID | Session ID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Ns (opt) | Nr (opt) | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Offset Size (opt) | Offset pad... (opt) +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Figure 3.1 L2TP Message Header T(ype) bit = 0 from client to server; 1 from server to client L(ength) bit = 1 if length is present S(equence) bit = 1 if Ns and Nr are present O(ffset) bit = 1 if offset is present bits with x = 0 always If client sets Ns and Nr, server swaps them. Otherwise, it fills Ns and Nr when replying to client. In this project, the header's first two bytes are to be interpreted as given above for each of the different bits. If the Length bit is set, the third and fourth byte are assumed to have length field. Otherwise, it will have the tunnel ID followed by Session ID. If the S bit is set, Ns and Nr are present. Otherwise, if O is set, the offset is present. If not, the header ends with the Tunnel and Session IDs. Accept from the command line, arguments to control whether to have length, sequence and offset. The values for each of these can then be accepted, if the option is present, from the user for each new message sent out. The number of messages to send to the server will also be a command line argument. Group 4 : Implement as a TCP client and server using select Group 3 : Implement as a UDP server with select