sending UDP packets ?

69 views
Skip to first unread message

Noah Davids

unread,
Jun 17, 2020, 12:23:33 PM6/17/20
to packetdrill
Does anyone have any examples of sending UDP packets ?

Neal Cardwell

unread,
Jun 17, 2020, 12:31:06 PM6/17/20
to Noah Davids, packetdrill
Hi Noah,

Below are some (IPv4) UDP examples from our internal packetdrill suite, which we have not had a chance to post upstream yet. Feel free to let me know how these work for you.

best,
neal

--------------
    0 socket(..., SOCK_DGRAM, IPPROTO_UDP) = 3

// Send the biggest possible UDP/IPv4 packet (without fragmentation).                                                                                              
 +.01 sendto(3, ..., 1472, 0, ..., ...) = 1472
   +0 > udp (1472)

// RFC 791 says the minimum IPv4 MTU is 68 bytes, so we should allow this.                                                                                        
 +.01 < icmp unreachable frag_needed mtu 68 [udp (1472)]

 +.01 < udp (1472)
   +0 recvfrom(3, ..., 1472, 0, ..., ...) = 1472

--------------
    0 socket(..., SOCK_DGRAM, IPPROTO_UDP) = 3

 +.01 connect(3, ..., ...) = 0

   +0 getsockopt(3, IPPROTO_IP, IP_MTU, [1500], [4]) = 0

// Send the biggest possible UDP/IPv4 packet (without fragmentation).                                                                                              
   +0 write(3, ..., 1472) = 1472
   +0 > udp (1472)

// Check behavior with an MTU of net.ipv4.route.min_pmtu = 552 (512 + 20 + 20)                                                                                    
 +.01 < icmp unreachable frag_needed mtu 552 [udp (1472)]

 +.01 < udp (1472)
   +0 read(3, ..., 2000) = -1 EMSGSIZE (Message too long)
   +0 read(3, ..., 2000) = 1472



On Wed, Jun 17, 2020 at 12:23 PM Noah Davids <nda...@redhat.com> wrote:
Does anyone have any examples of sending UDP packets ?

--
You received this message because you are subscribed to the Google Groups "packetdrill" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packetdrill...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packetdrill/528d82c2-1d00-4346-8dea-59a0ef3892cco%40googlegroups.com.

Noah Davids

unread,
Jun 18, 2020, 12:22:59 PM6/18/20
to packetdrill
Yes thank you. Is there any documentation on packetdril which explains all of the command line arguments

Neal Cardwell

unread,
Jun 18, 2020, 12:53:31 PM6/18/20
to Noah Davids, packetdrill
On Thu, Jun 18, 2020 at 12:23 PM Noah Davids <nda...@redhat.com> wrote:
Yes thank you. Is there any documentation on packetdril which explains all of the command line arguments

I'm afraid that I'm not aware of one. Most of the flags are implicitly documented in the comments for the corresponding field in struct config in config.h, in case that helps. Aside from that, reading the code that uses the options is, I'm afraid, the best guide.

Are there any in particular you are curious about?

If anyone has time to put together a doc or man page I am happy to review it and merge it into the github repo.

best,
neal

 

--
You received this message because you are subscribed to the Google Groups "packetdrill" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packetdrill...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages