Problem Receiving the first OSPF packet


 
Thread Tools Search this Thread
Special Forums IP Networking Problem Receiving the first OSPF packet
# 1  
Old 09-23-2008
Problem Receiving the first OSPF packet

I trying to send and receive OSPF packets. I am using RAW Sockets(socket(AF_INET, SOCK_RAW, IPPROTO_OSPF)) to do this.

I am successfully able to send an OSPF Hello packet however I am not able to receive a OSPF packet if I have not sent an OSPF packet earlier on the RAW SOCKET.
Scenario:

Working
Send_OSPF_packet()
Receive_OSPF_packet()

Not Working
Receive_OSPF_packet()

I see the receive packet using ethereal packet capture. However my application does not get the packet. I see that its got to do with kernal/os/lower layer (Not sure which one) not passing the packet to my RAW socket.

What do I have to do to Receive the First OSPF packet?

The Code written by me is in C language.
I use Winsock. The OS I use is Microsoft XP professional sp2

Please let me know of anymore details required.
# 2  
Old 09-23-2008
What happens when you send yourself a hello packet? Have you tried sending a HELLO packet from another client? (zebra, cisco, etc).
# 3  
Old 09-23-2008
Are you listening on 224.0.0.5? or 224.0.0.6?
If the IP next-header field set correctly? (89)

Just some wild stabs in the dark Smilie

/Fimblo
# 4  
Old 09-24-2008
Thanks for the reply and sorry for late reply. but I think that problem is not understood correctly.
I will try more explanation.
This is what I do. I do not interact with a an OSPF client as yet.
I am trying to develop code which could just send and receive OSPF packet.

Scenario1:
PC1

1) send any ospf packet(need not be an Hello packet) to PC2.
and wait for a OSPF packet.

PC2

2) See in Ethereal packet sniffer the packet

PC2

3) Send any OSPF packet to PC1.

PC1

4) My application is able to receive the OSPF packet. and also can see the packet in the ethereal packet sniffer

The above scenario works as expected but when
scenario2.

PC1

1) Wait for any OSPF packet(Application has not sent an OSPF packet yet)

PC2

2) Send an OSPF packet to PC1

PC1

3) Can see the packet in ethereal packet sniffer but my application times out waiting on the raw socket(Not received the data).

Why in the second scenario would my application not get the data from the kernal/os?

Well for fimblo's question

1) What happens when you send yourself a hello packet? Have you tried sending a HELLO packet from another client? (zebra, cisco, etc).

Ans. I just receive and ICMP message (Destination Unreacable | Protocol Unreachable). As I do not have a OSPF client on the other machine.
However this gives me an idea of going through zebra code. and figuring out how are they able to receive the packets.
I will also try doing as suggested in coming days. as that is my next step.

2) Are you listening on 224.0.0.5? or 224.0.0.6?
If the IP next-header field set correctly? (89)

Ans. I was just listening on the raw socket that I used to send and receive data in scenario 1.

Please Forgive me any inconsistencies I am just an amateur programmer and new to discussion forums.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Android

Nexus 7 Bluetooth receiving problem

I have three devices of which one is the Nexus 7. When this detects incoming files from either of the two others, it comes to life and I check that it is paired and connected, but the accept or reject file dialogue does not APPEAR. I have three devices of which one is the Nexus 7. When this ... (0 Replies)
Discussion started by: Royalist
0 Replies

2. AIX

Packet loss coming with big packet size ping

(5 Replies)
Discussion started by: Vishal_dba
5 Replies

3. Programming

Receiving JPEG packet from camera

I am trying to receive a packet of data as bytes in C, but the picture is getting messed up. I am using fwrite to append bytes to jpg file, but the append or write does not seem to be appending jpg correctly. Packet 1 data comes in append to file Packet 2 data comes in append to file ...... (12 Replies)
Discussion started by: photon
12 Replies

4. UNIX for Dummies Questions & Answers

Problem when I try to install a wireshark packet

Hi Gurus of UNIX, I has a problem when I try to install a packet in my virtual box. (I install solaris in it) Any want can help whith it: The problem is the following # pkgadd -d wireshark-1.2.10-sol10-x86-local The following packages are available: 1 SMCwires wireshark ... (5 Replies)
Discussion started by: andresguillen
5 Replies

5. Programming

Receiving broadcast packets using packet socket

Hello I try to send DHCP RENEW packets to the network and receive the responses. I broadcast the packet and I can see that it's successfully sent using Wireshark. But I have difficulties receiving the responses.I use packet sockets to catch the packets. I can see that there are responses to my... (0 Replies)
Discussion started by: xyzt
0 Replies

6. IP Networking

packet loss problem

I have 4 network ports on our T5240 sun server. all but 1 gives packet losses (nxge1) nxge0 gives on average 50% packet loss, very bad. nxge2 gives on average 1-2% packet loss. nxge3 gives on average 20% packet loss. Is there a tool or something to help me find the problem? (11 Replies)
Discussion started by: photon
11 Replies

7. Programming

problem receiving data from TCP socket

Hi all, I'm writing a socket program which sends a structure from one machine to another. When I run my client first time it runs well, however after the first time I couldn't receive all the data inside the structure (it is like, half of the array is received and the other half is not set). I... (1 Reply)
Discussion started by: SaTYR
1 Replies

8. IP Networking

Importance of LS length in DB exchange start packet (OSPF protocol)?

Is there any importance of LS length in DB exchange packet of OSPF protocol as its should be always be 20 bytes. Is this length to be ignored (2 Replies)
Discussion started by: cosmic_egg
2 Replies

9. Ubuntu

packet inconsistency problem

Hello everyone, I was trying to install db2 on Ubuntu, but got messed up with manual installation and Synaptic. At the moment, I find myself with a filesystem where DB2 is NOT installed ( I removed it with a sudo rm :o ) and with Synaptic still flagging db2exc as installed. The problem is that... (1 Reply)
Discussion started by: clalfa
1 Replies
Login or Register to Ask a Question