REDES DE COMPUTADORAS
ANALIZADOR DE TRAMAS
By:
Robles Jimnez Mauricio Alejandro
Professor:
M. en C. NIDIA ASUNCIN CORTEZ DUARTE
JUNIO 2016
ndex
Contenido
Problem:......................................................................................................................2
Hypothesis:..................................................................................................................2
Software (libraries, packages, tools):..............................................................................2
Procedure:................................................................................................................2-8
Results (Data):........................................................................................................8-12
Conclusions:..............................................................................................................12
References:..............................................................................................................30
Code....................................................................................................................12-30
Problema:
Realizar un analizador de tramas, que identifique cada uno de los protocolos
vistos en clase y imprima la informacin necesaria de cada cabecera.
Hipotesis:
La programacin ser usada con base en el anterior programa que fue el
analizador LLC, analizando correctamente cada capa de la trama como vimos
en clase, nicamente editando cada cabecera para sacar correctamente la
informacin de la trama .
Software y herramientas a utlizar:
DevC++
Cabeceras de los protocolos
Procedimiento:
Protocolo IP
CABECERA
MAC header
IP header
Data :::
0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3
31
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0
Version
IHL
Differentiated
Services
Identification
TTL
Total length
Flags
Protocol
Fragment offset
Header checksum
Source IP address
Destination IP address
Options and padding :::
Para sacar la versin del protocolo se hace la siguiente operacin:
T[14]>>4&15
T[14]&15)*4
T[18]*256+T[19]
Calculamos el Offset:
T[20]&31*256+T[21]
switch(T[23]){
Valor
1
6
17
Otros
Protocolo
ICMP
TCP
UDP
No soportado
Imprimimos el Checksum:
T[24]*256+T[25]
for(i=26;i<29;i++)
printf("%i:",T[i]);
printf("%i\n",T[29]);
for(i=30;i<33;i++)
printf("%i:",T[i]);
printf("%i\n",T[33]);
if(tope>34)
while(i<=tope){
printf("%x ",T[i]);
i++;
Protocolo IP-ICMP
CABECERA
MAC header
IP header
ICMP header
Data :::
0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
Type
Code
Tipo
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
if(T[23]==1)
switch(T[i])
Descripcin
Echo reply.
Referencias
RFC 792
Destination unreachable.
Source quench.
Redirect.
Alternate host address.
RFC 792
RFC 792
RFC 792
Echo request.
Router advertisement.
Router solicitation.
Time exceeded.
Parameter problem.
Timestamp request.
Timestamp reply.
Information request. Obsolete.
RFC 792
RFC 1256
RFC 1256
RFC 792
RFC 792
RFC 792
RFC 792
RFC 792
3
16
17
18
19
20
29
30
31
32
33
34
35
36
37
38
39
40
41
42
255
RFC 792
RFC 950
RFC 950
Traceroute.
Conversion error.
Mobile Host Redirect.
IPv6 Where-Are-You.
IPv6 I-Am-Here.
Mobile Registration Request.
Mobile Registration Reply.
Domain Name request.
Domain Name reply.
SKIP Algorithm Discovery Protocol.
Photuris, Security failures.
Experimental mobility protocols.
Reserved.
RFC 1393
RFC 1475
RFC 1788
RFC 1788
RFC 2521
RFC 4065
Descripcion
Redirect Datagram for the Network
Redirect Datagram for the Host
Redirect Datagram for the TOS & Network
Redirect Datagram for the TOS & Host
Descripcion
Time to Live exceeded in Transit
Fragment Reassembly Time Exceeded
Descripcion
Pointer indicates the error
Missing a Required Option
Bad Length
CABECERA
.::Protocolo envio::.
01
000101
Dir.Orig
en
T[13]
0001
10
0
Dir.
Tipo
Desti
tram
no
a
T[13]-T[14]
00
Enrutamie
nto
T[14]
Protocolo IP-TCP
CABECERA
MAC header
IP header
TCP header
Data :::
0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
Source Port
Destination Port
Sequence Number
Acknowledgment Number
Data
Offset
reserv
ed
ECN
Control Bits
Checksum
Window
Urgent Pointer
T[24]+T[25]
T[26]+T[29]
Numero de secuencia
T[28]+T[29]+T[30]+T[31]
Numero de reconocimiento T[32]+T[33]+T[34]+T[35]
Offset
T[36]<<4
Bit de control
cb[T[37]]
Ventana
T[38]+T[39]
Checksum
T[40]+T[41]
Apuntador de urgencia
T[42]+T[43]
Opciones
opcitcp[T[44]]
Protocolo IP-UDP
CABECERA
MAC header
IP header
UDP header
Data :::
0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
Source Port
Destination Port
Length
Checksum
Data :::
En el caso de que no entre en ninguno de los otros 2 casos entonces ser una
trama de tipo UDP entonces solamente imprimimos el puerto origen, el destino
la longitud de la tramam y el checksum:
Puerto origen
T[24]+T[25]
Puerto destino
T[26]+T[27]
Longitud de la trama
T[28]+T[29]
Checksum
T[30]+T[31]
Protocolo ARP
CABECERA
MAC header
ARP header
Data :::
ARP header:
0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
Hardware type
Hardware address
length
Protocol type
Protocol address
length
Opcode
Primero checamos si los bits 12 y 13 sean igual a 2054, de ser asi entra al
protocolo ARP y imprimimos el tipo de direccin de hardware:
if((T[12]<<8)+(T[13])==2054)
TH[((T[14])+T[15])])
if(((T[16]>>3)+T[17])==2048)
if(((T[18]))==6)
if(((T[19]))==4)
Operacin OP[T[20]+T[21]]
Direccion HO
T[22],T[23],T[24],T[25],T[26],T[27]
Direccion PO
T[28],T[29],T[30],T[31]
Direccion HD
T[32],T[33],T[34],T[35],T[36],T[37]
Direccion PD
T[38],T[39],T[40],T[41]
Capturas de pantalla:
10
11
Concluciones:
En este semestre aprendimos como codificar diferentes tipos de analizadores,
para los diferentes tipos de protocolos que existen en las redes todo ello para
comprender ms a fondo como es que se mandan las tramas y la informacin a
travs de las redes, y la programacin a nivel de bit que es cmo se maneja
una trama, tambin aprendimos los diferentes tipos de protocolos y sus
variantes.
Codigo
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int analizartrama(unsigned char*T, unsigned char*cadena);
int crc(unsigned char *T, short int tam);
12
int main(){
unsigned char trama[20][125]={
/* TRAMA 1 */
{
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x23, /* .......# */
0x8b, 0x46, 0xe9, 0xad, 0x08, 0x06, 0x00, 0x01, /* .F...... */
0x08, 0x00, 0x06, 0x04, 0x00, 0x01, 0x00, 0x23, /* .......# */
0x8b, 0x46, 0xe9, 0xad, 0x94, 0xcc, 0x39, 0xcb, /* .F....9. */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x94, 0xcc, /* ........ */
0x39, 0xfe
/* 9. */
},
/*TRAMA 2 */
{
0x00, 0x23, 0x8b, 0x46, 0xe9, 0xad, 0x00, 0x1f, /* .#.F.... */
0x45, 0x9d, 0x1e, 0xa2, 0x08, 0x06, 0x00, 0x01, /* E....... */
0x08, 0x00, 0x06, 0x04, 0x00, 0x02, 0x00, 0x1f, /* ........ */
0x45, 0x9d, 0x1e, 0xa2, 0x94, 0xcc, 0x39, 0xfe, /* E.....9. */
0x00, 0x23, 0x8b, 0x46, 0xe9, 0xad, 0x94, 0xcc, /* .#.F.... */
0x39, 0xcb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 9....... */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */
0x00, 0x00, 0x00, 0x00
/* .... */
},
/* TRAMA 3 */
{
0x00, 0x1f, 0x45, 0x9d, 0x1e, 0xa2, 0x00, 0x23, /* ..E....# */
0x8b, 0x46, 0xe9, 0xad, 0x08, 0x00, 0x46, 0x00, /* .F....F. */
13
/* .... */
},
/* TRAMA 4 */
{
0x00, 0x02, 0xb3, 0x9c, 0xdf, 0x1b, 0x00, 0x02, /* ........ */
0xb3, 0x9c, 0xae, 0xba, 0x00, 0x04, 0xf0, 0xf0, /* ........ */
0x01/*aqui es el de control
0x00, /* ........ */
/* :. */
},
/* TRAMA 6*/
{
0x00, 0x23, 0x8b, 0x46, 0xe9, 0xad, 0x00, 0x1f, /* .#.F.... */
0x45, 0x9d, 0x1e, 0xa2, 0x08, 0x06, 0x00, 0x01, /* E....... */
0x08, 0x00, 0x06, 0x04, 0x00, 0x02, 0x00, 0x1f, /* ........ */
0x45, 0x9d, 0x1e, 0xa2, 0x94, 0xcc, 0x3a, 0xe1, /* E.....:. */
0x00, 0x23, 0x8b, 0x46, 0xe9, 0xad, 0x94, 0xcc, /* .#.F.... */
0x39, 0xcb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 9....... */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */
0x00, 0x00, 0x00, 0x00
/* .... */
},
/* TRAMA 7 */
{
0x00, 0x23, 0x8b, 0x46, 0xe9, 0xad, 0x00, 0x1f, /* .#.F.... */
0x45, 0x9d, 0x1e, 0xa2, 0x08, 0x00, 0x45, 0x00, /* E.....E. */
0x00, 0x6f, 0x90, 0x30, 0x40, 0x00, 0xfb, 0x11, /* .o.0@... */
0x24, 0xe7, 0x94, 0xcc, 0x67, 0x02, 0x94, 0xcc, /* $...g... */
0x39, 0xcb, 0x00, 0x35, 0x04, 0x0c, 0x00, 0x5b, /* 9..5...[ */
0xe8, 0x60, 0xe2, 0x1a, 0x85, 0x80, 0x00, 0x01, /* .`...... */
0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x03, 0x77, /* .......w */
0x77, 0x77, 0x03, 0x69, 0x73, 0x63, 0x05, 0x65, /* ww.isc.e */
0x73, 0x63, 0x6f, 0x6d, 0x03, 0x69, 0x70, 0x6e, /* scom.ipn */
15
/* ...*0 */
},
/* TRAMA 8 */
{
0x00, 0x1f, 0x45, 0x9d, 0x1e, 0xa2, 0x00, 0x23, /* ..E....# */
0x02, 0x03, 0x04, 0x05, 0x08, 0x00, 0x45, 0x00, /* .F....E. */
0x00, 0x42, 0x04, 0x56, 0x00, 0x00, 0x80, 0x11, /* .B.V.... */
0x6b, 0xef, 0x94, 0xcc, 0x39, 0xcb, 0x94, 0xcc, /* k...9... */
0x67, 0x02, 0x04, 0x0c, 0x00, 0x35, 0x00, 0x2e, /* g....5.. */
0xff, 0x87, 0x68, 0x2a, 0x01, 0x00, 0x00, 0x01, /* ..h*.... */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x77, /* .......w */
0x77, 0x77, 0x03, 0x69, 0x73, 0x63, 0x05, 0x65, /* ww.isc.e */
0x73, 0x63, 0x6f, 0x6d, 0x03, 0x69, 0x70, 0x6e, /* scom.ipn */
0x02, 0x6d, 0x78, 0x00, 0x00, 0x01, 0x00, 0x01 /* .mx..... */
},
/* TRAMA 9 */
{
0x00, 0x1f, 0x45, 0x9d, 0x1e, 0xa2, 0x00, 0x23, /* ..E....# */
0x8b, 0x46, 0xe9, 0xad, 0x08, 0x00, 0x45, 0x00, /* .F....E. */
0x00, 0x3c, 0x04, 0x57, 0x00, 0x00, 0x80, 0x01, /* .<.W.... */
16
/* hi */
},
/* TRAMA 10 */
{
0x00, 0x02, 0xb3, 0x9c, 0xdf, 0x1b, 0x00, 0x02, /* ........ */
0x02, 0x03, 0x04, 0x05, 0x00, 0x04, 0xf0, 0xf0, /* ........ */
0x0c,/*control*/ 0xc7,/*extendida*/ 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, /* ........ */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */
0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x9b, 0x6d /* .....|.m */
},
/* trama 11 */
{
0x00, 0x02, 0xb3, 0x9c, 0xae, 0xba, 0x11, 0x11, /* ........ */
0x11, 0x11, 0x11, 0x11, 0x00, 0x03, 0xf0, 0xf0, /* ........ */
0x63, /*control*/ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */
17
/* hi */
},
/* trama 13 */
{
0x00, 0x02, 0xb3, 0x9c, 0xae, 0xba, 0x00, 0x01, /* ........ */
0x02, 0x03, 0x04, 0x05, 0x00, 0x03, 0xf0, 0xf1, /* ........ */
0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */
18
/* defghi */
},
/* trama 15*/
{
0x00, 0x23, 0x8b, 0x46, 0xe9, 0xad, 0x00, 0x1f, /* .#.F.... */
0x45, 0x9d, 0x1e, 0xa2, 0x08, 0x00, 0x00, 0x01, /* E....5.. */
0x08, 0x00, 0x06, 0x04, 0x00, 0x03, 0x00, 0x1f, /* ........ */
0x45, 0x9d, 0x1e, 0xa2, 0x94, 0xcc, 0x3a, 0xe1, /* E.....:. */
0x00, 0x23, 0x8b, 0x46, 0xe9, 0xad, 0x94, 0xcc, /* .#.F.... */
0x39, 0xcb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 9....... */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */
0x00, 0x00, 0x00, 0x00, 0xd8, 0xee, 0xdf, 0xb0 /* ........ */
19
},
/* trama 16 */
{
0x00, 0x02, 0xb3, 0x9c, 0xae, 0xba, 0x22, 0x22, /* ........ */
0x22, 0x22, 0x22, 0x22, 0x00, 0x03, 0xf0, 0xf0, /* ........ */
0x73,/*control*/ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */
0x00, 0x00, 0x00, 0x00, 0x43, 0x05, 0x90, 0x6d /* ....C..m */
},
/*trama 17 */
{
0x00, 0x02, 0xb3, 0x9c, 0xae, 0xba, 0x00, 0x02, /* ........ */
0xb3, 0x9c, 0xdf, 0x1b, 0x00, 0x03, 0xf0, 0xf0, /* ........ */
0x53,/*control*/ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */
0x00, 0x00, 0x00, 0x00, 0x43, 0x05, 0x90, 0x6d /* ....C..m */
},
/* trama 18 */
{
0x02, 0xff, 0x53, 0xc3, 0xe9, 0xab, 0x00, 0xff, /* ..S..... */
20
/* ...... */
},
/*trama 19 */
{
0x00, 0x02, 0xb3, 0x9c, 0xae, 0xba, 0x00, 0x02, /* ........ */
0xb3, 0x9c, 0xdf, 0x1b, 0x00, 0x03, 0xf0, 0xf1, /* ........ */
0x53, 0x0b, 0x0e, 0x00, 0xff, 0xef, 0x14, 0x00, /* ........ */
0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x7f, 0x23, /* ..(....# */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */
0x00, 0x00, 0x00, 0x00, 0x01, 0x99, 0x98, 0x6d /* .......m */
},
/* trama 20 */
{
0x00, 0xff, 0x66, 0x7f, 0xd4, 0x3c,/*mD*/ 0x02, 0xff, /* ..f..<.. */
0x53, 0xc3, 0xe9, 0xab,/*mO*/ 0x08, 0x00,/*tot*/ 0x45,/*V*/ 0x00/*ToS*/,
/* S.....E. */
0x00, 0x30,/*Total Lenght*/ 0x05, 0xc4, /*Identification*/0x40, 0x00,
/*FLags and FO*/0x80,/*TtL*/ 0x06/*Protocol*/, /* .0..@... */
0x71, 0xb0,/*checksum*/ 0xc0, 0xa8, 0x01, 0x01, 0xc0, 0xa8, /* q....... */
21
/* ...... */
}};
22
23
else
if(((T[12]<<8)+(T[13]))==2048){//Protocolo IP
printf("\n.::Protocolo IP::.\n");
printf("Version: %i\n",T[14]>>4&15);
printf("IP Header Length: %i\n",(T[14]&15)*4);
unsigned char tope=((T[14]&15)*4)+13;//Limite de la cabecera IP
printf("Servicios:\n");
if(T[15]&16)
printf("\tMinimize delay\n");
if(T[15]&8)
printf("\tMaximize througthout\n");
if(T[15]&4)
printf("\tMaximize reliability\n");
if(T[15]&2)
printf("\tMinimize cost\n");
printf("Total: %i\n",T[16]);
printf("Identification: %i\n",(T[18]*256+T[19]));
printf("banderas: ");
if(T[20]&64)
printf("Sin fragmentar\n");
else if(T[20]&32)
printf("Mas de un fragmento\n");
else printf("\n");
printf("Offset: %i\n",(T[20]&31)*256+T[21]);
printf("TTL: %i\n",T[22]);
printf("Protocolo: ");
24
switch(T[23]){
case 1: printf("ICMP\n");
break;
case 6: printf("TCP\n");
break;
case 17:printf("UDP\n");
break;
default:printf("No soportado\n");
break;
}
printf("Header Checksum: %i\n",(T[24]*256)+T[25]);
printf("Direccion origen: ");
for(i=26;i<29;i++)
printf("%i:",T[i]);
printf("%i\n",T[29]);
printf("Direccion destino: ");
for(i=30;i<33;i++)
printf("%i:",T[i]);
printf("%i\n",T[33]);
if(tope>34){//Imprime lo que se encuentre en el campo de opciones
adicionales
i=34;
printf("Opciones: ");
while(i<=tope){
printf("%x ",T[i]);
i++;
}
25
printf("\n");
}
if(T[23]==1){//Codigo para ICMP
i++;//Se incrementa una unidad para salir de IP
printf("\n.::Cabecera ICMP::.\n");
printf("Tipo de mensaje ICMP: ");
switch(T[i]){
case 0: printf("Echo Reply\n");
break;
case 3: printf("Destino inalcanzable: ");
switch(T[i+1]){
case 0: printf("Red inalcanzable\n");
break;
case 1: printf("Host inalcanzable\n");
break;
case 2: printf("Protocolo inalcanzable\n");
break;
case 3: printf("Puerto inalcanzable\n");
break;
case 4: printf("Paquete demasiado grande, no es posible
fragmentarlo\n");
break;
case 5: printf("Error de router origen\n");
break;
case 6: printf("Error desconocido en la red destino\n");
break;
case 7: printf("Error desconocido en el host de destino\n");
26
break;
case 8: printf("Host de origen aislado\n");
break;
case 9: printf("Acceso a la red destino denegado\n");
break;
case 10:printf("Acceso no autorizado al host destino\n");
break;
case 11:printf("Red inalcanzable para este servicio\n");
break;
case 12:printf("Host inalcanzable para este servicio\n");
break;
case 13:printf("Comunicacion no autorizada\n");
break;
}
break;
case 4: printf("Disminucion del trafico desde el origen (source
quench)\n");
break;
case 5: printf("Cambio de ruta: ");
switch(T[i+1]){
case 0: printf("Redireccionar todos los datagramas para una
red\n");
break;
case 1: printf("Redireccionar todos los datagramas para un
host\n");
break;
case 2: printf("Redireccionar todos los datagramas de un servicio
para una red\n");
27
break;
case 3: printf("Redireccionar todos los datagramas de un servicio
para un host\n");
break;
}
break;
case 8: printf("Echo request\n");
break;
case 9: printf("Anuncio de router\n");
break;
case 10:printf("Seleccion de router\n");
break;
case 11:printf("Tiempo excedido: ");
switch(T[i+1]){
case 0: printf("Tiempo de vida en transito excedido\n");
break;
case 1: printf("Tiempo de reensamble de fragmentos excedido\n");
break;
}
break;
case 12:printf("Problema de parametros ");
switch(T[i+1]){
case 0: printf("Error indicado en el puntero\n");
break;
case 1: printf("Se perdio una opcion requerida\n");
break;
case 2: printf("Mala longitud\n");
28
break;
}
break;
case 13:printf("Marca temporal\n");
break;
case 14:printf("Respuesta de marca temporal\n");
break;
case 15:printf("Solicitud de informacion\n");
break;
case 16:printf("Respuesta de informacion\n");
break;
case 17:printf("Solicitud de mascara de direccion\n");
break;
case 18:printf("Respuesta de mascara de direccion\n");
break;
case 30:printf("Traceroute\n");
break;
}
}//Termina ICMP
else if(T[23==17]){
printf("protocolo udp\n");
i++;
printf("Puerto origen %d\n",(T[24]+T[25]));
printf("Puerto destino %d\n",(T[26]+T[27]));
printf("lenght %d\n ",(T[28]+T[29]));
printf("Checksum %d\n ",(T[30]+T[31]));
}
}//Termina IP
return -1;
}
Referencias:
http://www.networksorcery.com/enp/protocol/802/ethertypes.htm
http://www.comunidad.escom.ipn.mx/ealdana/redesnp/tcp_ip/tcpip%5b1%5d.pdf
30
31