CCE 2020: LAB 6

Learning about the Simple Lightweight Transport Protocol (SLTP)

This Lab is divided into 2 main parts

1)Learning about the New Transport Protocol

2)Running the Simple Lightweight Transport Protocol

LOGGING ON

If you are on dual-booted machine: logon as admin

User name: admin

Password: greatjob

If you are using a virtual machine; Please use the login sequence given to you by your Lab tutor

PART1: Learning about the New Transport Protocol

PART1 is divided into 4 sections:

  1. Why design a New Transport Protocol
  2. Looking at the TCP header
  3. Looking at the SLTP: header
  4. Difference between TCP and SLTP

SECTION1: Why design a new Transport Protocol

Download the SLTP specification in the Lab folder. Read the Introduction and answer the following questions. What was the motivation behind the creation of SLTP?

A network communication that can be used in many environments. That is fast, has a low latency that also provides a reliable connection. That is unmodified and is able to run over other protocols. It can be run in the kernel and in the user space.

What is a VANET network why are VANETs different from other networks.

Vehicular Ad-hoc Network. It moves cars as nodes to create a network. The cars are then turned into wireless routers or nodes.It’s different from other networks because the nodes are always moving.

Why doesn’t TCP perform well on VANET networks?

TCP is sends ACKs after data segments are received. This lead to the system being slower, which is why TCP doesn’t work on VANET networks.

SECTION2: Look at the TCP header

Answer the following questions:

1) What units are used for the sequence number and the acknowledgement number?

Bytes

2) What is the maximum size of the receive window in a TCP header?

65,535 bytes

3) Does TCP use have a packet type field? How does TCP know which type of packets that are being received?

Identification field

4) Describe how TCP starts a connection: describe the packets exchanged

Client sends SYN packet and receives a SYN+ACK from the server. Client then replies with an ACK. Connection established.

5) Describe how TCP ends a connection: describe the packets exchanged

Client sends FIN packet and receives a FIN+ACK from the server. Client replies with FIN. Connection terminated.

6) How does TCP prevent replay attacks?

TCP prevents replay attacks by assigning a randomly chosen sequence number to the other device. Which need to be replied to with a ACK within the timeout interval.

7) Describe how TCP does flow control?

Using a sliding window protocol. Slow start and congestion avoidances. Also using congestion avoidance algorithm.

SECTION 3: Looking at an SLTP header

Look at the SLTP specification and answer the following questions:

1) What units mess_seq_no and the mess_ack_no in SLTP?

16 bits

2) What is the maximum size of the receive window in a SLTP header?

22 bits

3) Does SLTP use have a packet type field? How does SLTP know which type of packets that are being received?

Yes. 4 bits

Yes. SLTP has 8 different types of packets.

4) Describe how SLTP starts a connection: describe the packets exchanged

2 way handshake. The client sends a (SYN/ start) packet and requests an (ACK/ reply) packet. Server sends (ACK/ reply) packet and starts idle timer. Connection established. Client is able to send data.

5) Describe how SLTP ends a connection: describe the packets exchanged

3 way handshake. Client send END packet and requests a reply. Server sends reply. Client sends FIN. Connection terminated.

6) How does SLTP prevent replay attacks?

SLTP prevent replay attacks with it SYNC_NO. When the connection is started up the SYNC_NO generates a random 10 bit number. When a connection is setup the a sync number will be sent to the other client, one will also be received. Communication can only proceed through that sync number.

7) Describe how SLTP does flow control?

SLTP flow control is done by calculating the maximum burst size when the connection is set up. This is kept throughout so the pipe is full. If NACKs are received the measurements are repeated. Also the application can measure the bandwidth and latency of a connection when it chooses to.

SECTION 4: The difference between TCP and SLTP

Using your answers in Sections 2 and Section 3 write a paragraph about the difference between TCP and SLTP.

PART2: Running the Simple Lightweight Transport Protocol

PART2 is divided into 4 sections:

  1. Understanding C Libraries
  2. Compiling the SLTP Server
  3. Compiling the SLTP Client
  4. Running the Server and Client
  5. Explore More

SECTION1: Understanding C Libraries

Because SLTP is an experimental transport protocol, we cannot run it over the Internet because it is not TCP-friendly. Find out what being TCP-friendly means. In addition, these restrictions also mean that we cannot allow you to have the source code!! So you will be given access through a C library. Find out how C Libraries work, you do not get access to the code, so how does that work.

In your home directory, make the directories of srcand bin. Check that your bin directory is in your PATH (See Lab 1).

Go to the Lab Module Web page and download the files for this Lab.

Take a look at the files, which file contains the SLTP library?

Client.c, libsp.a, Server.c, Server.h, spv2.h, usertimemod.h

SECTION2: Compiling the SLTP Server

The SLTP Server you will compile actually encrypts and using an encryption algorithm called XXTEA. Find out more about XXTEA. This server is therefore an example of Encryption as a Service (EnaaS). Compile the server as follows:

gcc -o server server.c –L./(a space here)libsp.a -lpthread

so please type:

gcc –o server server.c –L./ libsp.a -lpthread

There may be a lot of warnings depending on how strict your compiler is but the code should compile.

Move the executable file into the bin directory

SECTION 3: Compiling the SLTP Client

Now compile the client as follows:

gcc -o client client.c -L./ (a space here) libsp.a -lpthread

so please type:

gcc –o client client.c –L./ libsp.a -lpthread

There may be a lot of warnings depending on how strict your compiler is but the code should compile.

Again, move the executable file into the bin directory

SECTION 4: Running the Server and the Client

So we need to run the server first. We have to give use the local interface and we have to give a UDP port number. Please use ports between 6000 and 7000 in number. Why can’t I use from 0 to 1023?

This is because port 0 to 1023 are well known ports and are used for system processes.

Open two windows: in one window please start the server by typing:

server 0.0.0.0 6072 (or whichever port number you chose)

So, for example: type:

server 0.0.0.0 6072

in another window type:

client 0.0.0.0 6072 (or whichever port number you chose) 1024 0

so, for example, type:

client 0.0.0.0 6072 1024 0

Write down the time taken on the client side. This is given by the value of the time_diff variable on the client side. Increase the number of bytes by multiplying by 2 so then try 2048 (i.e., 2 * 1024) and then 4096 up to 64K. So try values such as 1024, 2048, 4096, 8192, 16384, 32768, 65536 or 64K.

Then try:

client 0.0.0.0 6072 (or which every port number you chose) 1024 1

so type:

client 0.0.0.0 6072 1024 1

So try values such as 1024, 2048, 4096, 8192, 16384, 32768, 65536 or 64K.

Plot a graph of the numberof bytes sent on the x-axis and the corresponding time_diff values for two sets of readings. What can I learn from these graphs?

Orange line is when the client has 1 at the end. On the graph its timediff is higher than the blue line. This is probably due to the change from 0 to 1 after the IP address and the increased bytes

SECTION 5: Explore more

1)When we compile the files; we use the term –lpthread. Why do we do that?

-lpthread links the pthread library to code.

2)Does EaaS seem like a good idea? If so, why? If not, why not?

References