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.

53 lines
2.1 KiB

  1. Hello,
  2. This folder contains details for Test_Case3.
  3. 1. Version = 4
  4. 2. IHL = 5, which indicates 20 bytes.
  5. 3. Type Of Service (ToS) = 0,
  6. 4. Total Length = 40 bytes, which is 28 in hex.
  7. 5. Identification = 3,
  8. 6. Flags = The flags are set to zero,
  9. 7. Fragment Offset = 0 for now,
  10. 8. Time To Live (TTL) = 40s, which is 28 in hex.
  11. 9. Protocol = 6, which indicates TCP protocol is used.
  12. 10. Header Checksum = initially zero and then changed to the sum of 16 bit values of header + data.
  13. 11. Source Address = 172.168.5.3, which is aca8 0503 in hex.
  14. 12. Destination Address = 172.168.5.4, which is aca8 0504 in hex.
  15. 13. Source Port = 5555, which is 15b3 in hex.
  16. 14. Destination Port = 6666, which is 1a0a in hex.
  17. 15. Sequence Number = 0,
  18. 16. Acknowledgement Number = 0,
  19. 17. Data Offset = 5, as it indicates the number of bytes after which data starts. The number 5 represents that data starts after 20 bytes. The data offset value is scaled by 4.
  20. 18. RSV = The reserved bits are set to zero for now.
  21. 19. Flgas: set according to the packet type.
  22. 20. Window Size = 0
  23. 21. TCP Checksum = initially zero, then:
  24. (i) Concatenate TCP Pseudo header (Protocol, Source IP, Destination IP, Total Length) with TCP header and TCP data. This creates a big integer.
  25. (ii) Convert this integer to binary and compute bit wise 1's complement.
  26. 22. Urgent Pointer = 0 for now.
  27. The value of header comes out to be:
  28. header = {}
  29. header[0] = 0x45, Version, IHL
  30. header[1] = 0x00, TOS,
  31. header[2] = 0x00, Total Length,
  32. header[3] = 0x28, Total Length,
  33. header[4] = 0x00, Identification,
  34. header[5] = 0x03, Identification,
  35. header[6] = 0x00, Flags + Fragment Offset,
  36. header[7] = 0x00, Flags + Fragment Offset,
  37. header[8] = 0x28, TTL
  38. header[9] = 0x06, Protocol
  39. header[10] = 0x00, Header Checksum
  40. header[11] = 0x00, Header Checksum
  41. header[12] = 0xac, Source IP,
  42. header[13] = 0xa8, Source IP,
  43. header[14] = 0x05, Source IP,
  44. header[15] = 0x03, Source IP,
  45. header[16] = 0xac, Destination IP,
  46. header[17] = 0xa8, Destination IP,
  47. header[18] = 0x05, Destination IP,
  48. header[19] = 0x04, Destination IP,
  49. The value of IP_Header_Checksum comes out to be: 2f76.