Making magic with the network stack
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
1.7 KiB

  1. This folder contains details for Test_Case1.
  2. The values for the header fields are:
  3. 1. Verison = 4, to indicate IPv4 version is used.
  4. 2. IHL = 5, which indicates 20 bytes.
  5. 3. Type of Service = 0,
  6. 4. Total Window size = 40, which is 28 in hex. The total windows size contains the total lenght of IP header plus data.
  7. 5. Identification = 0001,
  8. 6. Flags = All flags are set to zero,
  9. 7. Fragment Offset = For now, there is no fragment offset so, this value is set to 0.
  10. 8. TTL = 40s, which is 28 in hex.
  11. 9. Protocol = 6, which indicates TCP.
  12. 10. Header Checksum = initially zero and then changed to the 1's complement of the sum of 16 bit values of IP header + data.
  13. 11. Source IP = 200.204.10.12, which is c8cc 0a0c in hex
  14. 12. Destination IP = 200.204.10.14, which is c8cc 0a0e in hex
  15. 13. Source Port = 1234, which is 04D2 in hex,
  16. 14. Destination Port = 4444, which is 115c in hex.
  17. 15. Sequence Number = 0 for now,
  18. 16. Acknowledgement Number = 0,
  19. 17. Flags:
  20. For the SYN packet, the SYN Flag in the header has a value of 1.
  21. For the SYN+ACK packet, the SYN and ACK flags in the header have a value of 1.
  22. For the ACK packet, the ACK flag in the header has a value of 1.
  23. For the FIN packet, the FIN flag in the header has a value of 1.
  24. For the FIN+ACK packet, the FIN and ACK flags in the header have a value of 1.
  25. 18. TCP Checksum = initially zero, then:
  26. (i) Concatenate TCP Pseudo header (Protocol, Source IP, Destination IP, Total Length) with TCP header and TCP data. This creates a big integer.
  27. (ii) Convert this integer to binary and compute bit wise 1's complement.
  28. References:
  29. 1. https://www.thegeekstuff.com/2012/05/ip-header-checksum/
  30. 2. https://www.tutorialspoint.com/calculation-of-tcp-checksum