Simple Network Discovery Protocol

Embed Size (px)

Citation preview

  • 8/13/2019 Simple Network Discovery Protocol

    1/9

    Simple Network Discovery Protocol(SNDP)

    Ver. 1.02

    May 28, 2011

    Moe Weatley, !"#$%

    &is speci'icatio escri*es a simple protocol tat ca *e +se to iscover c+stom etwork coecteevices +si a simple *roacast -DP sceme.

  • 8/13/2019 Simple Network Discovery Protocol

    2/9

    &a*le o' otets

    1. Simple Network Discovery Protocol /verview......................................................................................................

    1.1. Concept...............................................................................................................................................................31.2. Discovery Procedure........................................................................................................................................... 3

    1.3. Modification Procedure....................................................................................................................................... 4

    2. Network Discovery Messae ormat................................................................................................................. ....

    2.1. Overall Packet Format........................................................................................................................................ 52.1.1 Fixed Common Field Definitions.................................................................................................................... 52.1.2 Examples of Filling fixed common fields........................................................................................................ 62.1.3 Example of Modifying a Devices Settings using ead Modify !"ite..............................................................#

    2.2. Custom Field Packet Formats............................................................................................................................. 2.2.1 SD$%& and 'etSd" Custom Field &ac(et Definitions....................................................................................)

    2.2.2 SD$%* and SD$1+ ,sing Se"ve" Custom Field &ac(et Definitions............................................................-

    e". 1./2 2/11$/5$2) 2

  • 8/13/2019 Simple Network Discovery Protocol

    3/9

    1. Simple Network Discovery Protocol /verview

    1.1.Concept

    0 fundamental "eui"ement fo" connecting to a a"da"e device on a neto"( is to (no te devices neto"(pa"amete"s suc as %& add"ess4 po"t nume"4 etc. Many devices do not ave any use" inte"face to allo setting o"canging te neto"( pa"amete"s so some ote" means is "eui"ed.

    is p"otocol is a simple metod to discove" neto"(ed devices using "oadcast ,D& messages. e sceme useste same asic ,D& "oadcast message sceme as D7C& except te messages a"e customi8ed to te specific devicessuppo"ted y te p"otocol.

    e (ey is tat te sceme uses ,D& "oadcast messages9%& add"ess 255.255.255.255: on a specific po"t. isallos communication it any device pysically connected to a neto"( ut ose %& and po"t settings a"e un(non asell as canging tese settings "emotely. ese messages ill only o"( on local neto"(s.

    1.2.Discovery Procedure

    e seuence of events a"e as follos fo" otaining a devices pa"amete"s;

    1. &C sends a ,D& "oadcast euest Message to a device tat is listening on &o"t +)321.2. e device ten sends a ,D& "oadcast esponse Message to te &C ic is listening on &o"t +)322.

    e "esponse message contains its pe"tinent neto"( pa"amete"s.

    e". 1./2 2/11$/5$2) 3

    &C&o"t +)322

    &C&o"t +)322

    Device&o"t +)321

    Discove" euest Msg

    Discove" esponse Msg

    ,D&

  • 8/13/2019 Simple Network Discovery Protocol

    4/9

    1.3.Modification Procedure

    0 simila" means can e used to set a devices neto"( pa"amete"s using a "oadcast ,D& message;

    e &C simply sends a ,D& "oadcast Set message tat en te device "eceives it4 "econfigu"es its neto"( to tepa"amete"s specified in te Set message. e device ten sends a ,D& "oadcast esponse Message ac( to te &Ccontaining te canged settings. is "esponse can e used as an ac(noledge as ell as a means to indicate any fieldstat could not e set.

    is sceme can e expanded to allo discove"ing and modifying ote" custom pa"amete"s depending on at tedevice is.

    e". 1./2 2/11$/5$2) +

    &C&o"t +)322

    Device&o"t +)321

    Discove" Set Msg

    ,D&

  • 8/13/2019 Simple Network Discovery Protocol

    5/9

    2. Network Discovery Messae ormate discove"y message pac(ets a"e va"iale lengt pac(ets containing va"ious yte fields tat contain message type

    info"mation as ell as te pa"amete"s of te specific device.

    e message is divided into to sections. e fi"st section is "eui"ed and its fields a"e fixed in lengt and its

    definitions a"e common to all discove"y messages and all devices suppo"ting te p"otocol. e second optional section isva"iale lengt and te yte fields a"e custom to te pa"ticula" device.

    Note! t"e term #little endian $yte order% refers to t"e order t"at multi $yte data items are stored in memory and isleast si&nificant $yte first order. ' 1( $it )ord )ould $e stored as parameter*+,--$its /+0 parameter*1,--$its 15/.

    2.1.Overall Packet Format

    e message pac(et contains a fixed 56 yte field folloed y a va"iale lengt custom field tat is specific to apa"ticula" device.

    st"uct D%SC=E>MS?@ AAfixed common 56 yte fields

    unsigned ca" lengtB2 AAlengt of total message in ytes 9little endian yte o"de":unsigned ca" (eyB2 AAfixed (ey (eyB//x50 (eyB1/x05unsigned ca" op AA/euest9to device: 1esponse9f"om device: 2 Set9to device:ca" nameB16 AADevice name st"ing null te"minatedca" snB16 AASe"ial nume" st"ing null te"minatedunsigned ca" ipadd"B16 AAdevice %& add"ess 9little endian yte o"de":unsigned ca" po"tB2 AAdevice &o"t nume" 9little endian yte o"de":unsigned ca" customfield AASpecifies a custom data field fo" a pa"ticula" device

    ..AAsta"t of optional va"iale custom yte fields

    unsigned ca" CustomB'

    2.1.1 i3e ommo iel De'iitios

    e fi"st 2 yte 16 it field GlengtG is te total message lengt in little endian yte o"de".

    e second 2 yte 16 it field G(eyG is a fixed value used to identify tis pac(et as a discove"y pac(et in te "a"e casete"e a"e ote" "oadcast pac(ets on tis po"t.

    e ti"d 1 yte field GopG identifies te type of discove"y message. 0 value of / is defined as a euest messagef"om te &C client to te device. 0 value of 1 is a esponse message f"om te device to te &C4 and a value of 2 is a Setmessage f"om te &C to te device. 0ll ote" values a"e "ese"ved.

    e fou"t fixed 16 yte GnameG field is a va"iale 8e"o te"minated ca"acte" st"ing identifying te exte"nal device. 0nyunused ytes in te 16 yte field sould e set to 8e"o. is st"ing is te p"ima"y identifie" of te device on te neto"(. 0device must alays fill in tis field en sending a "esponse message ac( to te &C.

    e &C can leave tis field all 8e"os en sending a "euest message and all devices "ega"dless of tei" name to

    discove" all devices it any name on te neto"(.

    e fift fixed 16 yte GsnG field is a va"iale 8e"o te"minated ca"acte" st"ing identifying te se"ial nume" of teexte"nal device. 0ny unused ytes in te 16 yte field sould e set to 8e"o. is st"ing can e used to distinguismultiple devices it te same name on te neto"(. 0 device must alays fill in tis field en sending a "esponsemessage ac( to te &C.

    e &C can leave tis field all 8e"os en sending a "euest message to discove" all devices it te same nameon te neto"(.

    e". 1./2 2/11$/5$2) 5

  • 8/13/2019 Simple Network Discovery Protocol

    6/9

    e sixt fixed 16 yte Gipadd"G field is te %& add"ess of te device in little endian yte o"de". %f tis is a "euestmessage4 te field is igno"ed y te device. %f it is a set message ten tis is te %& add"ess tat te device souldcange to. %f it is a "esponse message f"om te device4 tis is te cu""ent %& add"ess of te device.

    e sevent fixed 2 yte Gpo"tG field is te po"t nume" of te device in little endian yte o"de". %f tis is a "euestmessage4 te field is igno"ed y te device. %f it is a set message ten tis is te po"t nume" tat te device souldcange to. %f it is a "esponse message f"om te device4 tis is te cu""ent po"t nume" of te device.

    e last yte of te fixed common field can e used to specify diffe"ent custom field fo"mats fo" te same device.

    2.1.2 "3amples o' illi 'i3e commo 'iels.

    D%SC=E>MS? msg

    Eample PC re!uest messa"e for any devices on net#ork$memset99voidH:Imsg4 /4 si8eof9D%SC=E>MS?:: AA8e"o out all fieldsmsg.(eyB/ /x50 AAfill in (ey valuesmsg.(eyB1 /x05msg.op / AA"euest messagemsg.lengtB/ 56 AAset message lengt of Just te fixed section

    Eample PC re!uest messa"e for any device #it% t%e name &MyDevice' on t%e net#ork$memset99voidH:Imsg4 /4 si8eof9D%SC=E>MS?:: AA8e"o out all fieldsmsg.(eyB/ /x50 AAfill in (ey valuesmsg.(eyB1 /x05msg.op / AA"euest messagest"cpy9 msg.name4 KMyDeviceL : AAfi ll in name st"ing fieldmsg.lengtB/ 56 AAset message lengt of Just te fixed section

    Eample simple Device response messa"e #it% t%e name &MyDevice' on t%e net#ork$memset99voidH:Imsg4 /4 si8eof9D%SC=E>MS?:: AA8e"o out all fieldsmsg.(eyB/ /x50 AAfill in (ey valuesmsg.(eyB1 /x05

    msg.op 1 AA"esponse messagest"cpy9 msg.name4 KMyDeviceL : AAfi ll in name st"ing field

    AAassume device %& add"ess is 1-2.16-.1.1// on po"t 123+5msg.ipadd"B/ 1// AAdevice %& add"ess9 little endian yte o"de":msg.ipadd"B1 1msg.ipadd"B2 16)msg.ipadd"B3 1-2msg.po"tB/ 123+5I/x//FF AAdevice &o"t 'ume"9 little endian yte o"de":msg.po"tB1 123+5)msg.lengtB/ 56 AAset message lengt of Just te fixed section

    Eample PC set messa"e for device #it% t%e name &MyDevice' on t%e net#ork$memset99voidH:Imsg4 /4 si8eof9D%SC=E>MS?:: AA8e"o out all fields

    msg.(eyB/ /x50 AAfill in (ey valuesmsg.(eyB1 /x05msg.op 2 AAset messagest"cpy9 msg.name4 KMyDeviceL : AAfi ll in name st"ing field

    AAassume ant to set device %& add"ess to 1-2.16-.5.32 on po"t 5+321msg.ipadd"B/ 32 AAdevice %& add"ess9 little endian yte o"de":msg.ipadd"B1 5msg.ipadd"B2 16)msg.ipadd"B3 1-2msg.po"tB/ 5+321I/x//FF AAdevice &o"t nume"9 little endian yte o"de":

    e". 1./2 2/11$/5$2) 6

  • 8/13/2019 Simple Network Discovery Protocol

    7/9

    msg.po"tB1 5+321)msg.lengtB/ 56 AAset message lengt of Just te fixed section

    2.1. "3ample o' Moi'yi a Devices Settis +si 4ea Moi'y Write.

    =ne can save o"( y fi"st "eading all te devices settings4 modify te fields tat need to cange4 ten send temessage ac( out as a Set message to te device.

    e". 1./2 2/11$/5$2) #

    &C

    &C

    Device

    Discove" euest Msg

    Discove" esponse Msg

    ?ot filled in fields f"om device so only update fields tat

    Device

    &CDiscove" Set Msg

    a"e to e canged ten send Set message it modified fields.

    &CDiscove" esponse Msg

  • 8/13/2019 Simple Network Discovery Protocol

    8/9

    2.2.Custom Field Packet Formats

    e custom fields a"e defined fo" specific devices as tey contain info"mation uniue to tat device. ese fields a"eappended afte" te fixed common fields of te discove" message it te total lengt of te message adJusted to includete ext"a ytes of te custom fields. e folloing sections desc"ie cu""ently suppo"ted devices.

    2.2.1 SD456P a NetSr +stom iel Packet De'iitios

    st"uct >D%SC=E>MS?>'ESD@ AAfixed common 56 yte fields

    unsigned ca" lengtB2 AAlengt of total message in ytes 9little endian yte o"de":unsigned ca" (eyB2 AAfixed (ey (eyB//x50 (eyB1/x05unsigned ca" op AA/euest9to device: 1esponse9f"om device: 2 Set9to device:ca" nameB16 AADevice name st"ing null te"minatedca" snB16 AASe"ial nume" st"ing null te"minatedunsigned ca" ipadd"B16 AAdevice %& add"ess 9little endian yte o"de":unsigned ca" po"tB2 AAdevice &o"t nume" 9little endian yte o"de":

    unsigned ca" customfield AASpecify a custom data field fo" a pa"ticula" deviceAAsta"t of optional va"iale custom yte fields

    unsigned ca" macadd"B6 AA7! mac add"ess 9little endian yte o"de": 9"ead only:unsigned ca" ve"B2 AA7a"da"e ve"sionH1// 9little endian yte o"de": 9"ead only:unsigned ca" fve"B2 AAFi"ma"e ve"sionH1// 9little endian yte o"de":9"ead only:unsigned ca" tve"B2 AA

  • 8/13/2019 Simple Network Discovery Protocol

    9/9

    2.2.2 SD4567 a SD451# -si Server +stom iel Packet De'iitios

    st"uct >D%SC=E>MS?>SDNN@ AAfixed common 56 yte fields

    unsigned ca" lengtB2 AAlengt of total message in ytes 9little endian yte o"de":unsigned ca" (eyB2 AAfixed (ey (eyB//x50 (eyB1/x05

    unsigned ca" op AA/euest9to device: 1esponse9f"om device: 2 Set9to device:ca" nameB16 AADevice name st"ing null te"minatedca" snB16 AASe"ial nume" st"ing null te"minatedunsigned ca" ipadd"B16 AAdevice %& add"ess 9little endian yte o"de":unsigned ca" po"tB2 AAdevice &o"t nume" 9little endian yte o"de":unsigned ca" customfield AASpecify a custom data field fo" a pa"ticula" device

    AAsta"t of optional va"iale custom yte fieldsunsigned ca" fve"B2 AAFi"ma"e ve"sionH1// 9little endian yte o"de":9"ead only:unsigned ca" tve"B2 AA