One socket will be enough for a single-purpose device. We don't need the extra port for unicast, since we know that there won't be a different application on the device trying to do CoAP. So the same socket can be used to send and receive both unicast and multicast -- provided it has the API to tell the two apart (like IPV6_RECVPKTINFO).
As John said, security will be a build-time decision[*], so we won't need to have two sockets for that purpose either. [*] and that decision is "it's enabled". Non-DTLS devices should not pass certification. On Friday 24 April 2015 14:39:09 Light, John J wrote: > Joseph, > > A server may have three file descriptors (the fourth is only used for > clients). > > A typical server will only have two (since security will either be enabled > or disabled.) > > On a constrained server, only one connection will be active at a time > (multicast initially, unicast thereafter.) > > I don't think we can get below one. :-) > > John > > > -----Original Message----- > From: Morrow, Joseph L > Sent: Friday, April 24, 2015 1:52 PM > To: Macieira, Thiago > Cc: Light, John J; iotivity-dev at lists.iotivity.org > Subject: RE: [dev] Change in iotivity[master]: Integrated WIFI/ETHERNET > adapters to single IPAdapter. > > Hi Thiago, > > I agree that this would be a fine implementation. However, we could be > severely limiting the use-cases of a constrained platform with a finite > number of sockets available to only being able to have one connection at a > time. I'm not going to champion this, as I agree with your statement but I > do think we should constantly keep the "constrained device" in mind at all > times here. Without that, we could quickly become the 'Internet of Big > Devices' - *ahem* which kind of already exists. > > Thanks, > > Joey > -----Original Message----- > From: Macieira, Thiago > Sent: Friday, April 24, 2015 4:39 PM > To: Morrow, Joseph L > Cc: Light, John J; iotivity-dev at lists.iotivity.org > Subject: Re: [dev] Change in iotivity[master]: Integrated WIFI/ETHERNET > adapters to single IPAdapter. > > For a single-purpose device whose purpose is to send and receive OIC > protocol, using 3 of the 4 possible sockets for OIC seems reasonable to me. > > The fourth socket could be a simple web server that delivers a highly > compressed web app that is hardcoded to talk back to the device in > question, via OIC protocol again. > On Friday 24 April 2015 13:02:42 Morrow, Joseph L wrote: > > I would like to add a general note about "sockets aren't expensive". > > Currently, the Arduino WiFi (IIRC, it may have been the Ethernet > > Shield, or > > both!) shields will only let you bind with up to 4 sockets at a time. > > This makes sockets very expensive as we wouldn't want to leave the end > > user with just 1 socket after our stack has used 3 of them! > > -- > Thiago Macieira - thiago.macieira (AT) intel.com > Software Architect - Intel Open Source Technology Center -- Thiago Macieira - thiago.macieira (AT) intel.com Software Architect - Intel Open Source Technology Center
