Hash lookup
2016-08-23
0 0 0
no vote
Other
Earn points
Now the network information circulation is very fast, but also very complex, how to filter the bad information in the designated network information transmission, first of all to find the session. Let the hash function be packet (SIP, SPT, dip, DPT), and construct hash (packet) according to the following rules: (1) & nbsp; & nbsp; IP address: addr = SIP + dip, denoted as & nbsp; addr [31 (2) port number: Port = SPT + DPT, denoted as & nbsp; port [15 , 0] (of & nbsp; 16 & nbsp; bits); (3) & nbsp; construct digit group sum [59 ,0]=[addr[31,… , 0], 0 (12 bits), port [15 , 0]] (60 bits in total); (4) & nbsp; for & nbsp; sum [59 The result is RLT [19 The range space of hash function is: 0 ≤ hash (packet) ≤ 2 ^ 20-1 = 1m. Complete the code.
c
hash
查找
Related Source Codes
PClite
0
0
no vote
generic embeded FTP Client
0
0
no vote
UDP Test Demo
0
0
no vote
TMS320F28335 DSP transmits data to EEPROM through
0
0
no vote
TMS320F28335 CAN communication source code
0
0
no vote
No comment