Search code examples
network-programmingheaderudppacketpayload

UDP payload length and packet transmission


I have data 1245 MB for trasmission via UDP over IPv4. For calculation of expected number of packet transmission from A to B then B relay to C, if the data transmitted in blocks of size 320bytes (i.e; payload = 320bytes), and header is 20 bytes, do we minus 20 from 320 or add in?

For instance, 
1245MB = 1305477120 bytes
Total UDP Payload = 320 - 20 or 320 + 20?

Solution

  • The packet consists of:

    • the IP header (20 bytes)
    • the UDP header (8 bytes)
    • your payload (320 bytes).

    Total: 348 bytes.