how does wireshark identify DNS traffic when it also uses a Radius port in UDP port? And how can I tell? -


my program doing packet analysis. have problem around dns/radius. dns uses udp port 53 radius uses udp port 1645/1646/1812/1813

logic if see 53 dns packet; if see 1812... radius packets. problem comes, dns packets use radius ports e.g. udp port src 53/dst 1812 or vice verse. program cannot handle this.

but wireshark doesn't confused, wondering how capable of knowing true protocol. attempt decode payload? , tell? or underline libpcap or has ability tell true protocol type. if take use code libpcap, libpcap provide functionality of telling carrying protocols?

can please help? googled while got no results yet.

thanks kang

wireshark uses various techniques identify protocols. dns , radius, based on port number. code looks numerically lower port number first and, if doesn't find dissector port number, looks numerically higher port number, packet going between ports 53 , 1812 identified dns rather radius because 53, port dns, numerically lower 1812, port radius.

if there happened radius traffic between ports 1812 , 53, wireshark would confused.

the way work around have dns dissector try @ packet data , guess whether it's dns or have radius dissector try @ packet , guess whether it's radius and, if it's not packet dissector, return "this isn't me" indication dissector can tried.

there no magic solution guaranteed correctly identify protocols running on tcp or udp. there heuristics based on port numbers , packet contents; may right answer 99 44/100% of time, there still 56/100% of time when doesn't work , you'll have intervene manually (for example, using "decode as..." mechanism in wireshark, or -d command-line equivalent in tshark).

and, no, steffen ullrich indicated, libpcap doesn't you; different applications using libpcap (tcpdump, wireshark, etc.) may differently.


Comments

Popular posts from this blog

java - Static nested class instance -

c# - Bluetooth LE CanUpdate Characteristic property -

JavaScript - Replace variable from string in all occurrences -