Linux – Cargar un interfaz de red

por | 12 enero, 2012

A veces es necesario cargar un interfaz de red, para hacer determinadas pruebas. Un método es hace pings de gran tamaño a gran velocidad sobre la máquina destino.

ORIGEN

# ping -T tsonly -i 0.001 192.168.3.50 -s 40000

Estamos enviando un paquete cada milisegundo sobre el equipo 192.168.3.50 con un tamaño de paquete de 40008 bytes (4000 de payload + 8 de cabecera).

Evidentemente sobre una red Ethernet se realiza automáticamente la IP fragmentación y por
cada echo request se envían un cierto número de paquetes consecutivos.

[root@mfcc2grproc1 ~]# ping -T tsonly -i 1 192.168.3.50 -s 40000
PING 192.168.3.50 (192.168.3.50) 40000(40068) bytes of data.
40008 bytes from 192.168.3.50: icmp_seq=1 ttl=63 time=29.0 ms
TS:     31790335 absolute
        -397
        400
        12
        -394
        401

40008 bytes from 192.168.3.50: icmp_seq=2 ttl=63 time=25.7 ms
TS:     31791336 absolute
        -398
        402
        10
        -399
        401

40008 bytes from 192.168.3.50: icmp_seq=3 ttl=63 time=34.4 ms
TS:     31792337 absolute
        -398
        404
        15
        -399
        401
— 192.168.3.50 ping statistics —
3 packets transmitted, 3 received, 0% packet loss, time 2001ms
rtt min/avg/max/mdev = 25.714/29.741/34.433/3.595 ms
[root@mfcc2grproc1 ~]#

 

DESTINO

# tcpdump -i eth0 host 192.168.98.101 and proto\icmp

En el destino no hace falta hacer nada especial, podemos poner tcpdump para ver lo que
va llegando.

[root@nnsc2sbc1 ~]# tcpdump -i bond0 host 192.168.98.101 and proto\icmp
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on bond0, link-type EN10MB (Ethernet), capture size 96 bytes
08:50:32.619701 IP mfcc2grproc1 > nnsc2sbc1: ICMP echo request, id 56653, seq 1, length 1440
08:50:32.620075 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:32.620475 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:32.620958 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:32.621329 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:32.621698 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:32.622078 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:32.622321 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:32.622695 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:32.622947 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:32.625449 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:32.626945 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:32.627205 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:32.627455 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:32.627702 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:32.627949 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:32.628195 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:32.628445 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:32.628620 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:32.628945 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:32.629192 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:32.629330 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:32.629575 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:32.629824 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:32.630080 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:32.630325 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:32.630574 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:32.630823 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:32.630951 IP nnsc2sbc1 > mfcc2grproc1: ICMP echo reply, id 56653, seq 1, length 1440
08:50:32.630955 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:32.630958 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:32.630961 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:32.630965 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:32.630968 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:32.630971 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:32.630974 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:32.630977 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:32.630980 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:32.630984 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:32.630987 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:32.630990 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:32.630993 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:32.630996 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:32.630999 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:32.631002 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:32.631006 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:32.631009 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:32.631012 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:32.631015 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:32.631017 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:32.631020 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:32.631023 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:32.631026 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:32.631029 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:32.631032 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:32.631034 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:33.620245 IP mfcc2grproc1 > nnsc2sbc1: ICMP echo request, id 56653, seq 2, length 1440
08:50:33.620502 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:33.620996 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:33.621254 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:33.621629 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:33.622620 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:33.622996 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:33.623372 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:33.623621 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:33.623870 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:33.624127 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:33.624497 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:33.627549 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:33.627869 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:33.628230 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:33.630491 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:33.631114 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:33.631493 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:33.631867 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:33.632248 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:33.632613 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:33.633115 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:33.633363 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:33.633613 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:33.635613 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:33.636116 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:33.636487 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:33.636738 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:33.636887 IP nnsc2sbc1 > mfcc2grproc1: ICMP echo reply, id 56653, seq 2, length 1440
08:50:33.636894 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:33.636897 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:33.636901 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:33.636904 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:33.636907 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:33.636910 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:33.636913 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:33.636916 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:33.636918 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:33.636921 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:33.636924 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:33.636927 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:33.636930 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:33.636933 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:33.636937 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:33.636940 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:33.636943 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:33.636946 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:33.636949 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:33.636953 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:33.636956 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:33.636959 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:33.636962 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:33.636965 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:33.636968 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:33.636971 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:33.636974 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:34.620564 IP mfcc2grproc1 > nnsc2sbc1: ICMP echo request, id 56653, seq 3, length 1440
08:50:34.622045 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:34.622430 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:34.622794 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:34.623313 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:34.623924 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:34.624304 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:34.624791 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:34.625291 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:34.625667 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:34.626041 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:34.626418 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:34.627300 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:34.627557 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:34.627790 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:34.628054 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:34.628414 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:34.628664 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:34.628925 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:34.629041 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:34.629302 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:34.629683 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:34.630166 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:34.630798 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:34.631067 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:34.631319 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:34.631663 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:34.631916 IP mfcc2grproc1 > nnsc2sbc1: icmp
08:50:34.632039 IP nnsc2sbc1 > mfcc2grproc1: ICMP echo reply, id 56653, seq 3, length 1440
08:50:34.632044 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:34.632047 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:34.632050 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:34.632053 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:34.632056 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:34.632059 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:34.632062 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:34.632065 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:34.632068 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:34.632071 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:34.632073 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:34.632076 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:34.632079 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:34.632082 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:34.632085 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:34.632088 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:34.632091 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:34.632094 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:34.632097 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:34.632100 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:34.632103 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:34.632105 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:34.632108 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:34.632111 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:34.632114 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:34.632117 IP nnsc2sbc1 > mfcc2grproc1: icmp
08:50:34.632120 IP nnsc2sbc1 > mfcc2grproc1: icmp

168 packets captured
3181 packets received by filter
2792 packets dropped by kernel
[root@nnsc2sbc1 ~]#

Cuando aumentamos el intervalo entre paquetes (-i [milisegundos]) en el comando ping y el tamaño del paquete (-s [tamaño_payload]), estamos cambiando la tasa de transferencia que enviamos al destimo.

Por ejemplo:    -i 0.001  -s 4000

4008 bytes x 8
tasa = ————– = 320.064.000 bit/seg  (320 Mbits/s)
0,001 seg
Al aumentar la tasa aparecerán paquetes descartados pues el receptor no podrá atenderlos.
Además el ping reply se efectúa con un tamaño de paquete igual que el que recibe, por lo que
devuelta tendremos también el mismo flujo que de ida, con su fragmentación si es el caso.
Es decir, tandremos la misma tasa tanto en tráfico TX como en RX.

 

Deja una respuesta

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *