CS代写 COMP30023, Week 7 Practical

COMP30023, Week 7 Practical

Some TCP packets will have a higher level protocol decoded.

Copyright By PowCoder代写 加微信 powcoder

Wireshark will show the highest protocol it can decode for each packet.

The highlighted bytes are the bytes in the header that contain the
selected field.
Each layer will add a header (and sometimes a footer) to the packets
that it carries for lower layer protocols.

It varies depending on what protocols are carried in the packet, and
also the options used. Just count the header bytes for a given packet.

Higher layer protocols have their headers deeper (later) in the packet.

The protocols seen at different points of the network would be
different. If you have a wireless connection, you will have a different
layer 1 and 2 protocol than if you on Ethernet. If you are in the core
(the middle bit that carries most of the traffic), you may be on neither
of those, such as SDH/SONET or MPLS.

If you repeatedly access the same host, you should see very few DNS
packets (only when a table entry times out and has to be replaced).
If you access a new host, you will see a DNS exchange (request /
response).

Yes, I can explain it.

The value 1 is stored as 0x01000000 in host byte order (assuming little-endian).
When converted to network byte order, it is 0x00000001 (i.e. bytes 0 0 0 1).
This value is stored to ‘b’. When read, it represents 0x01000000 (decimal 16777216).

The value 65536 is stored as 0x00000100 in host byte order (assuming little-endian).
When converted to network byte order, it is 0x00010000 (i.e. bytes 0 1 0 0).
This value is stored to ‘b’. When read, it represents 0x00000100 (decimal 256).

Yes. On big-endian machines, htonl does nothing.
On little-endian machines, it reverses the order of the bytes.

You could also do (buf[12] & 16) >> 4
i.e. (buf[12] & 0b1000) >> 4

buf[11] >> 4

(buf[11] >> 1) & 7, where 7 is 0b111 (rightmost 3 bits)

100 -28 100
These are sensible when using “>> x” to divide by 2^x.

You should usually use unsigned types for manipulating bit fields.

程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com