IRC channel logs
2024-12-14.log
back to list of logs
<damo22>Pellescours: i reworked your 2 patches for rumpkernel so that they apply to upstream branch and then merge into master <damo22>looks like they fixed rss_getkey or whatever was missing <damo22>the only thing missing is implementations of send_packet and receive_packet <damo22>youpi: is UDP a superset of TCP? <damo22>ie, can i treat all packets to be sent as udp? <damo22>i dont know what data is coming into rumpnet device_write/device_read <Pellescours>TCP is statefull (connection with high confidence of remote getting packet) while UDP is stateless (you send packet and hope the remote get it) <damo22>if pfinet tries to send a udp packet for dhcp, will it arrive in rumpnet device_write() as a raw udp packet? <Pellescours>I don't know, but isn't DHCP a arp level protocol (because client don't have yet an ip)? <damo22>device is configured with 0.0.0.0 i think <damo22>so the broadcast to 255.255.255.255 hits it <ZhaoM>so CLOCK_MONOTONIC is mainly used for meansuring code duration? <youpi>damo22: TCP is a superset of UDP in terms of features <youpi>but they are separate protocols, both on top of IP <youpi>device_write/read are ethernet frames, yet another level (2) <youpi>ZhaoM: that's the idea, though I wouldn't phrase it this way <youpi>in that it's not just local code duration, it's a global clock that different processes can compare with each other <youpi>you can see it as the local time in the Einstein terms: it's the time as the local machine sees it flow <damo22>youpi: does pfinet always call device_read/write on a whole number of packets? ie i dont need to keep state in rumpnet to resume half a packet? <youpi>rumpnet doesn't need state at all <ZhaoM>youpi: Got it. BTW I like the analogy <youpi>that's why we can kill it without problem <youpi>(I do it quite often for netdde when it hangs) <damo22>is there a documentation on ethernet frames? <youpi>ZhaoM: although it's not exactly true in that clock_monotonic should try to follow the pace of clock_realtime in terms of measuring time <youpi>if the computer has a hardware clock that is a bit too slow, we should compense for this, and CLOCK_MONOTONIC follow that <youpi>but it's really compensation, not abrupt changes <youpi>ethernet is very trivial actually: destination/source mac addresses, and the type of payload (ipv4/v6/arp/something else) <damo22>for the header + raw data packet <youpi>see the ethhdr struct in if_ether.h <damo22>is the data packet always MTU in size? <damo22>theres no size field in the eth hdr <youpi>the size is passed as parameter <youpi>on the wire there is an ending special encoding <ZhaoM>it's wierd that $(glibc-2.40)/sysdeps/mach/clock_gettime.c does not have implementation for CLOCK_MONOTONIC case but I can still read something using clock_gettime (CLOCK_MONOTONIC...) <ZhaoM>youpi: which part of gnumach source code should I try to read for implementing CLOCK_MONOTONIC? <youpi>ZhaoM: in the debian package we patch of this by making CLOCK_MONOTONIC just use the CLOCK_REALTIME <damo22>youpi: does pfinet only send one packet at a time to device_read/write ? <youpi>but also look in the list archives, iirc there were already some existing unfinished work <youpi>damo22: only one whole packet at a time, yes <youpi>(one frame, more exactly, packet would be IP) <youpi>network drivers usually already work just that way (xmit/recv) <youpi>the svg is that, yes (without the crc, which is handled by the hardware) <damo22>youpi: send_packet wants the ip header as a separate blob <youpi>ip headers don't have a fixed size, no <youpi>but I don't understand why you are talking about ip packets <youpi>you shouldn't have to delve with it <youpi>since pfinet gives you ethernet frames <youpi>doesn't bpf take an ethernet frame? <youpi>or does it take eth/ip/tcp-udp separately? <youpi>the ip header size is given in the ip hdrlen field <youpi>it is given in number of 32bit words <youpi>so usually it is just 5, the minimum (no option) <damo22> iov [0].iov_base = ((char *)hw); <damo22> iov [1].iov_base = ((char *)ip); <damo22> iov [2].iov_base = (char *)raw; <damo22>so i think hw is the ethernet header , ip is the ip header and raw is the packet <damo22>but since they are just pointers, it should be some easy pointer arithmetic <youpi>also, you should use the totlen field of the ip header to compute the payload length <youpi>the ethernet frame could be longer for whatever reason <ZhaoM>youpi: it seems elapsed_ticks in mach_clock.c is the CLOCK_MONOTONIC we want <ZhaoM>so we just need to add a routine for reading elapsed_ticks in mach_host.defs and an implementation reading elapsed_ticks in mach_clock.c? <ZhaoM>and a case for CLOCK_MONOTONIC in glic <damo22>no i think that is only updated once per clock interrupt <damo22>so the timer will be accurate only to 0.01s <damo22>DHCPDISCOVER on /dev/wm0 to 255.255.255.255 port 67 interval 3 <damo22>DHCPDISCOVER on /dev/wm0 to 255.255.255.255 port 67 interval 4 <damo22>i wonder if its being packet filtered by bpf <ZhaoM>so there is precision requirement? <youpi>then you may want to refine the clock precision indeed <youpi>I don't remember if we have already something for that, but that's fine: clock are not supposed to be infinitely precise <youpi>having 10ms precision is already enough for most usages actually <youpi>posix etc. don't require more <ZhaoM>youpi: ok then I will try to investigate how to refine the precision <youpi>sneek: later tell ZhaoM as I said: it's not really needed to get a better precision, the current clock precision is fine for most use, it's having a *monotonic* clock that would be useful, even if at the same precision as we have now <sneek>Welcome back ZhaoM, you have 1 message! <sneek>ZhaoM, youpi says: as I said: it's not really needed to get a better precision, the current clock precision is fine for most use, it's having a *monotonic* clock that would be useful, even if at the same precision as we have now <youpi>heh, thanks sneek, exactly what was needed :)