Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
en:dpi:opt_cgnat:cgnat_diagnostics:start [2023/08/28 14:00] – ↷ Page moved from en:dpi:dpi_options:opt_cgnat:cgnat_diagnostics:start to en:dpi:opt_cgnat:cgnat_diagnostics:start elena.krasnobryzh | en:dpi:opt_cgnat:cgnat_diagnostics:start [Unknown date] (current) – removed - external edit (Unknown date) 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== 4 Description of NAT statistics ====== | ||
- | {{indexmenu_n> | ||
- | The output of statistics in fastdpi_stat.log is set by dbg_log_mask. | ||
- | 0x40000 | ||
- | 0x100000 | ||
- | 0x2000000 - NAT statistics output. | ||
- | |||
- | **Example: | ||
- | dbg_log_mask=0x2000000 | ||
- | |||
- | ==== Common for all profiles ==== | ||
- | < | ||
- | [STAT ][2021/ | ||
- | [STAT ][2021/ | ||
- | |||
- | itrnsl | ||
- | iprof - internal index of the profile | ||
- | profile - profile name | ||
- | nttype | ||
- | ref_cnt - counter of references of converter usage by profiles | ||
- | (Profiles can use one set of CIDR, but different number of restrictions per session) | ||
- | cidr - list of profile' | ||
- | </ | ||
- | |||
- | ==== CG-NAT Profile ==== | ||
- | < | ||
- | [STAT ][2021/ | ||
- | k=0, itrnsld=0, cidr=94.140.198.84/ | ||
- | total TCP : 30/ | ||
- | actual TCP : 0/0/0/0/0 0/0/0 0/0/0/0/0 0/0/0 | ||
- | total UDP : 13/ | ||
- | actual UDP : 0/0/0/0/0 0/0/0 0/0/0/0/0 0/0/0 | ||
- | total GRE : 0/0 | ||
- | </ | ||
- | |||
- | ==== Information on the data converter | ||
- | < | ||
- | k=0, itrnsld=0, cidr=94.140.198.84/ | ||
- | k - itrnsld number | ||
- | itrnsld - internal converter data index - the one serving the CIDR | ||
- | cidr - exact cidr | ||
- | |||
- | total - total statistics | ||
- | actual | ||
- | |||
- | total TCP : 30/ | ||
- | </ | ||
- | |||
- | **Four groups группы: | ||
- | 1 group -- operations with public address ports | ||
- | < | ||
- | 30/ | ||
- | |||
- | 30 - allocation of a new public port | ||
- | 20 - public port reuse | ||
- | 0 - errors of allocating a new public port | ||
- | 7 - performs decrement of number of subscriber sessions on flow releasing | ||
- | 17 - performs decrement of the number of subscriber sessions on public port reuse | ||
- | </ | ||
- | |||
- | 2 group -- general statistics | ||
- | < | ||
- | 0/0/0: | ||
- | |||
- | 0 - calculated CRC by IP when accessed to allocate a public address. Should be == 0 | ||
- | 0 - excessive number of sessions for subscribers | ||
- | 0 - different public addresses in flow and converters - Should be == 0 | ||
- | </ | ||
- | |||
- | 3 group -- cache statistics //private --> public// | ||
- | < | ||
- | 50/ | ||
- | |||
- | 50 - added records to cache | ||
- | 20 - deleted records from cache | ||
- | 0 - found records in cache when new public port is allocated | ||
- | 50 - no public address found for private | ||
- | 0 - errors of adding to cache | ||
- | </ | ||
- | |||
- | 4 group -- conversion statistics //public --> private// (// | ||
- | < | ||
- | 5516/ | ||
- | |||
- | 5516 - successful translation public --> private | ||
- | 8 - port is not in the allocated range of public ports | ||
- | 121 - translation public --> private was not found | ||
- | </ | ||
- | |||
- | For TCP/UDP and total/ | ||
- | |||
- | For GRE – it is GRE by default (when session is not found in PPTP). Only one such session can be created per public address. | ||
- | < | ||
- | total GRE : 0/0 | ||
- | 0 - address used | ||
- | 0 - number of attempts to create sessions on an already allocated public address | ||
- | </ | ||
- | |||
- | ==== 1:1 Profile ==== | ||
- | < | ||
- | [STAT ][2021/ | ||
- | k=0, itrnsld=1, cidr=16.35.121.0/ | ||
- | total 256/ | ||
- | </ | ||
- | |||
- | Group 2 statistics: \\ | ||
- | 1 group - 256/ | ||
- | 2 group - 0/0 | ||
- | |||
- | **Example: | ||
- | dbg_log_mask=0x2100000 | ||
- | |||
- | ==== Output of public addresses statistics ==== | ||
- | < | ||
- | [STAT ][2021/ | ||
- | k=0, itrnsld=0, cidr=94.140.198.84/ | ||
- | total TCP : 26/4/0/4/2/ 0/0/0 30/4/0/30/0 3045/1/36 | ||
- | actual TCP : 0/0/0/0/0 0/0/0 0/0/0/0/0 0/0/0 | ||
- | TCP whiteblck ip_mask=0x0, | ||
- | whip=94.140.198.84 : sb=64, lsb=64, nb=1008, whpa=64512, whpb=0, whpf=64512, awhb=4, fwhb=1004, puwhb=0.40% | ||
- | thr=0, ublock=1, uport=0 | ||
- | thr=1, ublock=1, uport=0 | ||
- | thr=2, ublock=1, uport=0 | ||
- | thr=3, ublock=1, uport=0 | ||
- | whip=94.140.198.86 : sb=64, lsb=64, nb=1008, whpa=64512, whpb=26, whpf=64486, awhb=4, fwhb=1004, puwhb=0.40% | ||
- | thr=0, ublock=1, uport=0 | ||
- | thr=1, ublock=1, uport=0 | ||
- | thr=2, ublock=1, uport=13 | ||
- | thr=3, ublock=1, uport=13 | ||
- | </ | ||
- | < | ||
- | TCP whiteblck ip_mask=0x0, | ||
- | |||
- | ip_mask - addresses mask | ||
- | nwhaddr - the number of public addresses that are under the mask | ||
- | </ | ||
- | < | ||
- | whip=94.140.198.84 : sb=64 ( 64 ), nb=1008, whpa=64512, whpb=0, whpf=64512, awhb=4, fwhb=1004, puwhb=0.40% | ||
- | |||
- | whip=94.140.198.84 - public address | ||
- | sb=64 - port block size | ||
- | lsb=64 | ||
- | nb=1008 | ||
- | whpa=64512 | ||
- | whpb=0 | ||
- | whpf=64512 | ||
- | awhb=4 | ||
- | fwhb=1004 | ||
- | puwhb=0.40% - percentage of blocks occupied | ||
- | </ | ||
- | |||
- | === Added in version 12.1.0 === | ||
- | < | ||
- | whp_salfs - how many ports are in the ' | ||
- | whp_lalfs - how many ports are in the ' | ||
- | whp_ruse | ||
- | whp_ruse_salfs - how many ports can be reused from the ' | ||
- | whp_ruse_lalfs - how many ports can be reused from the ' | ||
- | whp_dthr - how many ports were created in one worker thread but used in another thread | ||
- | whp_dthr_salfs | ||
- | whp_dthr_lalfs | ||
- | </ | ||
- | |||
- | Within the public address you can see the distribution of captured ports/ | ||
- | < | ||
- | thr=0, ublock=1, uport=0 | ||
- | thr=0 - worker thread number | ||
- | ublock=1 - public port blocks used | ||
- | uport=0 - public port blocks used | ||
- | </ | ||
- | < | ||
- | thr_salfs - how many ports are in the ' | ||
- | thr_lalfs - how many ports are in the ' | ||
- | thr_ruse - how many ports can be reused | ||
- | thr_ruse_salfs - how many ports can be reused from the ' | ||
- | thr_ruse_lalfs - how many ports can be reused from the ' | ||
- | thr_dthr - how many ports were created in one worker thread but used in another thread | ||
- | thr_dthr_salfs - how many ports were created in one worker thread but used in another from the ' | ||
- | thr_dthr_lalfs - how many ports were created in one worker thread but used in another from ' | ||
- | </ | ||
- | |||
- | The output format is the same. | ||
- | < | ||
- | fdpi_ctrl list status --service 11 --ip 192.168.4.20 | ||
- | Autodetected fastdpi params : dev=' | ||
- | connecting 94.140.198.68: | ||
- | |||
- | ================================ | ||
- | 192.168.4.20 | ||
- | </ | ||
- | |||
- | **Output:** | ||
- | < | ||
- | 192.168.4.20 - private IP | ||
- | crcip=0xd649d853 - CRC of the private IP | ||
- | nttype=0 | ||
- | profile=' | ||
- | itrnsl=0 - internal index of the converter private< | ||
- | itrnsld=0 | ||
- | whiteip=94.140.198.86 - public address | ||
- | sess_tcp=127 | ||
- | sess_udp=108 | ||
- | indmtd=4 | ||
- | |||
- | fdpi_ctrl list status --service 11 --ip 192.168.4.20 --outformat=json | ||
- | fdpi_ctrl list status --service 11 --ip 192.168.4.20 --outformat=json | ||
- | |||
- | fdpi_ctrl list all status --service 11 | ||
- | fdpi_ctrl list all status --service 11 --outformat=json | ||
- | </ | ||
- | The format is the same. | ||
- | |||
- | === Key to command to view NAT profile statistics via fdpi_ctrl === | ||
- | Command: | ||
- | < | ||
- | fdpi_ctrl list status --service 11 --profile.name cgnat | ||
- | </ | ||
- | Output: | ||
- | < | ||
- | nttype=0 | ||
- | itrnsld=0 | ||
- | proto=TCP | ||
- | proto=TCP | ||
- | nthr=0 | ||
- | nthr=1 | ||
- | </ | ||
- | Key: | ||
- | < | ||
- | nttype | ||
- | profile | ||
- | itrnsl | ||
- | nitrnsld | ||
- | itrnsld | ||
- | cidr - exact CIDR | ||
- | proto - TCP/UDP | ||
- | ip_mask | ||
- | nwhaddr | ||
- | whip - public address | ||
- | sb - size of the block of ports to be allocated | ||
- | lsb - size of the last block | ||
- | nb - number of prot blocks | ||
- | whpa - ports in total | ||
- | whpb - ports occupied | ||
- | whpf - free ports | ||
- | awhb - blocks issued | ||
- | fwhb - free blocks | ||
- | puwhb - percentage of blocks occupied | ||
- | whp_salfs | ||
- | whp_lalfs | ||
- | whp_ruse | ||
- | whp_ruse_salfs - can be used in ' | ||
- | whp_ruse_lalfs - can be used in ' | ||
- | whp_dthr | ||
- | whp_dthr_salfs - number of elements ithr_owner != ithr by ' | ||
- | whp_dthr_lalfs - number of elements ithr_owner != ithr by ' | ||
- | </ | ||
- | |||
- | === Key to command to view the dump NAT profile statistics === | ||
- | Command: | ||
- | < | ||
- | fdpi_cli -r 127.0.0.1: | ||
- | </ | ||
- | Output: | ||
- | < | ||
- | profile=' | ||
- | cidr=' | ||
- | whip=94.140.198.86 | ||
- | proto=TCP | ||
- | entryp : | ||
- | ithr=0, ihead=0, itail=0 | ||
- | ithr=1, ihead=0, itail=0 | ||
- | ithr=2, ihead=133, itail=265 | ||
- | ithr=3, ihead=193, itail=327 | ||
- | data : | ||
- | sind=129, inext=257, iprev=258, whport=1152, | ||
- | sind=130, inext=151, iprev=148, whport=1153, | ||
- | </ | ||
- | Key: | ||
- | < | ||
- | profile | ||
- | itrnsl | ||
- | |||
- | cidr - exact CIDR | ||
- | itrnsld | ||
- | |||
- | whip - public address | ||
- | proto - TCP/UDP | ||
- | </ | ||
- | The implementation of the used ports queue for public addresses uses a single array - let's call it WHP, of size 0xffff. It is used to build a list of used ports for the worker thread. | ||
- | Index 0 is used as a stub (empty). | ||
- | |||
- | Thread queues cannot be output as a list, because records in the queue are moved in the process, which may cause the output to loop. Therefore, the WHP array is output 'as is' for occupied entries. | ||
- | |||
- | < | ||
- | entryp : sets entry points to the list of public ports of the worker thread | ||
- | ithr - worker thread number | ||
- | ihead | ||
- | itail | ||
- | </ | ||
- | < | ||
- | data : WHP white port array data (only occupied entries are output) | ||
- | |||
- | sind - record index | ||
- | inext | ||
- | iprev | ||
- | |||
- | whport | ||
- | graddr | ||
- | tml - time of the last record access | ||
- | lifetime | ||
- | canreuse | ||
- | ialf - number of the processing queue : | ||
- | en_nalfs_shrt = 0, # queue with a short lifetime | ||
- | en_nalfs_long = 1, # long queue | ||
- | indmtd | ||
- | iown - owner thread which has created the record | ||
- | ilst - number of the thread which has last accessed the record | ||
- | subproto | ||
- | typedef enum en_nat_borrw_udp: | ||
- | { | ||
- | ennatborwu_ORG | ||
- | ennatborwu_DFLTGRE = 1, # общий GRE | ||
- | ennatborwu_MAX | ||
- | } en_nat_borrw_udp_t; | ||
- | |||
- | decr_sess | ||
- | ind_gcache_slice - index of the ' | ||
- | igcache | ||
- | </ |