Windows 10 Host and SSDP
Posted: 4. Apr 2020, 05:58
I am trying to implement SSDP (Simple Service Discovery Protocol) within my (hobby) OS. I am sending the following packet for discovery.
- Given in binary format for the sake of this post so to verify that, yes, I am sending the correct data.
- Obviously not the *protocol* chars shown and \r\n are the actual 13 10 bytes.
- Also, please note that this is the identical packet received from Windows 10 (upon a Host request) except that the UDP:SourcePort is different, which changes the check sum(s), etc.
Side note:
- I am using Virtual Box 6.1.4 r136177 (Qt5.6.2)
- Windows 10 Host
- Host-only Adapter
- VirtualBox Host-Only Ethernet Adapter
- Intel Pro/1000 MT Desktop (82540EM)
- Promiscuous Mode: Deny
- MAC Address: duhh, same as above
- "Cable Connected" is checked
When I send this to the host, I get nothing back. i.e.: There is no indication that the host received, verified, and/or replied. I get no packet received back, of any kind.
While VirtualBox is running in the background, from the Windows10:Explorer>Network window, if I hit F5 to refresh, I get the Windows 10 "discover" packet, (almost) identical to the one shown above.
This means that my packet driver is working, at least the receive part. I can verify that the send part works as well since (when activated) my DHCP framework sends packets which are responded to by the host.
Therefore, my conclusion is one of the following ideas/notes:
A) My sent packet is corrupt in one way or another, and the Host (Windows 10) is dropping it.
B) I am using a TTL value of 4, whereas the SSDP/UPnP specs say I should use a TTL value of 2. However, Windows 10 is sending me its packet with a value of 4, meaning they are using a TTL = 4.
C) I actually hard coded and sent a packet to be the exact packet received from the Host (Windows 10), changing only the necessary MAC, to see if it was my packet, therefore sending exactly the same packet as Windows 10 sends on its "discover" request. Nope, still no response.
D) Virtual Box is blocking my packet
E) Virtual Box's SSDP is not quite correct (doubtful) (does VirtualBox even emulate SSDP, or is it simply passed on to the Host? i.e.: No need to emulate at all.)
F) I tried a target MAC of "FF FF FF FF FF FF", and any other multicast MAC as well as a direct MAC address to the host (virtual adapter) and still cannot get a response.
Also, on a side note, if I use the PCnet-FAST III (Am79C973) emulation within Virtual Box, Windows 10 does not send a SSDP "discover" packet when hitting F5 from the host. It does when using the E1000 emulation. Without looking at the Virtual Box network emulation, I can't tell you why it would make a difference. I can't imagine SSDP being dependent on the packet driver. However, some how, Windows 10 as a Host, knows not to send the SSDP discovery protocol when the PCnet emulation is chosen. It sends a DHCP protocol Discover request instead.
I have searched around to find other similar issues:
https://www.virtualbox.org/ticket/8698#comment:4
States to set the "Automatic Metric" value. This had no change.
I have seen other posts stating that some people are having problems with multicast packets, but no one can pin-point the exact cause, so there is no fix.
The only thing I can think of next is to use a packet sniffer to see what is actually happening.
Has anyone here experienced a similar effect or has any idea what could be causing this effect?
Thank you for your time,
Ben
Code: Select all
*ETHERNET*
01 00 5E 7F FF FA ; target (translation of 239.255.255.250) (see note F)
08 00-27 00 AF 69 ; source (MAC address Virtual Box gives me)
08 00 ; IPv4
*IPv4*
45 ; version/header length
00 ; type of service
00 A1 ; total length
12 34 ; id
00 00 ; flags/fragment offset
04 ; time to live (see note (B) below)
11 ; protocol (UDP)
BB 5F ; header check sum
C0 A8 38 16 ; source (192.168.56.22)
EF FF FF FA ; target (239.255.255.250)
*UDP*
C0 02 ; source port (49154)
07 6C ; target port (1900)
00 8D ; udp length
59 AB ; udp check sum
*SSDP*
M-SEARCH * HTTP/1.1\r\n
Host: 239.255.255.250:1900\r\n
ST: urn:schemas-wifialliance-org:device:WFADevice:1\r\n
Man: "ssdp:discover"\r\n
MX: 3\r\n
\r\n
- Obviously not the *protocol* chars shown and \r\n are the actual 13 10 bytes.
- Also, please note that this is the identical packet received from Windows 10 (upon a Host request) except that the UDP:SourcePort is different, which changes the check sum(s), etc.
Side note:
- I am using Virtual Box 6.1.4 r136177 (Qt5.6.2)
- Windows 10 Host
- Host-only Adapter
- VirtualBox Host-Only Ethernet Adapter
- Intel Pro/1000 MT Desktop (82540EM)
- Promiscuous Mode: Deny
- MAC Address: duhh, same as above
- "Cable Connected" is checked
When I send this to the host, I get nothing back. i.e.: There is no indication that the host received, verified, and/or replied. I get no packet received back, of any kind.
While VirtualBox is running in the background, from the Windows10:Explorer>Network window, if I hit F5 to refresh, I get the Windows 10 "discover" packet, (almost) identical to the one shown above.
This means that my packet driver is working, at least the receive part. I can verify that the send part works as well since (when activated) my DHCP framework sends packets which are responded to by the host.
Therefore, my conclusion is one of the following ideas/notes:
A) My sent packet is corrupt in one way or another, and the Host (Windows 10) is dropping it.
B) I am using a TTL value of 4, whereas the SSDP/UPnP specs say I should use a TTL value of 2. However, Windows 10 is sending me its packet with a value of 4, meaning they are using a TTL = 4.
C) I actually hard coded and sent a packet to be the exact packet received from the Host (Windows 10), changing only the necessary MAC, to see if it was my packet, therefore sending exactly the same packet as Windows 10 sends on its "discover" request. Nope, still no response.
D) Virtual Box is blocking my packet
E) Virtual Box's SSDP is not quite correct (doubtful) (does VirtualBox even emulate SSDP, or is it simply passed on to the Host? i.e.: No need to emulate at all.)
F) I tried a target MAC of "FF FF FF FF FF FF", and any other multicast MAC as well as a direct MAC address to the host (virtual adapter) and still cannot get a response.
Also, on a side note, if I use the PCnet-FAST III (Am79C973) emulation within Virtual Box, Windows 10 does not send a SSDP "discover" packet when hitting F5 from the host. It does when using the E1000 emulation. Without looking at the Virtual Box network emulation, I can't tell you why it would make a difference. I can't imagine SSDP being dependent on the packet driver. However, some how, Windows 10 as a Host, knows not to send the SSDP discovery protocol when the PCnet emulation is chosen. It sends a DHCP protocol Discover request instead.
I have searched around to find other similar issues:
https://www.virtualbox.org/ticket/8698#comment:4
States to set the "Automatic Metric" value. This had no change.
I have seen other posts stating that some people are having problems with multicast packets, but no one can pin-point the exact cause, so there is no fix.
The only thing I can think of next is to use a packet sniffer to see what is actually happening.
Has anyone here experienced a similar effect or has any idea what could be causing this effect?
Thank you for your time,
Ben