473,390 Members | 1,402 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,390 software developers and data experts.

How can I read IP Datagram?

How can I read IP Datagram? Should I write some Driver for that? Is
there any special book about it?
Thank you.
Jan 27 '08 #1
8 3397
ba********@yahoo.com wrote:
How can I read IP Datagram? Should I write some Driver for that? Is
there any special book about it?
Thank you.
The is off topic and platform specific.

google for "UDP send recv socket select C++" - see what you get.

There are plenty of libraries that you can use - commonc++, austria C++,
ACE, that hide most of the platform dependant stuff.

I don't know of any standardization work for C++ with sockets, although,
that would be very very useful.
Jan 27 '08 #2
On 27 Jan., 23:30, Gianni Mariani <gi4nos...@mariani.wswrote:
babakan...@yahoo.com wrote:
How can I read IP Datagram? Should I write some Driver for that? Is
there any special book about it?
Thank you.

The is off topic and platform specific.

google for "UDP send recv socket select C++" - see what you get.

There are plenty of libraries that you can use - commonc++, austria C++,
* ACE, that hide most of the platform dependant stuff.

I don't know of any standardization work for C++ with sockets, although,
that would be very very useful.

Theres boosts asio, which I guess is as close as it gets. I do not
know if it supports UDP.

/Peter
Jan 27 '08 #3
ba********@yahoo.com wrote:
How can I read IP Datagram? Should I write some Driver for that? Is
there any special book about it?
Thank you.
I think your best bet is the sockets library. On Linux that's (as far as
I got around to use it) the same interface as winsock on Windows Systems.

Some links that may help you:
C++ Socket library tutorial:
http://www.alhem.net/Sockets/tutorial/using.html
Beej's Guide to Network Programming:
http://beej.us/guide/bgnet/output/ht...age/index.html

Best Regards,

Lars
Jan 28 '08 #4
On Jan 28, 8:17 am, Lars Uffmann <a...@nurfuerspam.dewrote:
babakan...@yahoo.com wrote:
How can I read IP Datagram? Should I write some Driver for that? Is
there any special book about it?
Thank you.

I think your best bet is the sockets library. On Linux that's (as far as
I got around to use it) the same interface as winsock on Windows Systems.

Some links that may help you:
C++ Socket library tutorial:http://www.alhem.net/Sockets/tutorial/using.html
Beej's Guide to Network Programming:http://beej.us/guide/bgnet/output/ht...age/index.html

Best Regards,

Lars
You guys talk about using transport layer mechanisms (TCP/UDP), but
babakan asked about IP (network layer) datagrams. A far as I know it
is impossible to access IP layer datagrams with socket mechanisms
directly. Not that I know how to do it other way:)
Jan 28 '08 #5
szybki wrote:
You guys talk about using transport layer mechanisms (TCP/UDP), but
babakan asked about IP (network layer) datagrams.
Oops, sorry - forgive my ignorance - only just entered the topic this
year - wasn't aware that sockets was limited to the higher layers.

Thanks for pointing that out & Best Regards,

Lars
Jan 28 '08 #6
On Jan 28, 4:52 am, szybki <andrzej.dajnow...@gmail.comwrote:
On Jan 28, 8:17 am, Lars Uffmann <a...@nurfuerspam.dewrote:
babakan...@yahoo.com wrote:
How can I read IP Datagram? Should I write some Driver for that? Is
there any special book about it?
Thank you.
I think your best bet is the sockets library. On Linux that's (as far as
I got around to use it) the same interface as winsock on Windows Systems.
Some links that may help you:
C++ Socket library tutorial:http://www.alhem.net/Sockets/tutorial/using.html
Beej's Guide to Network Programming:http://beej.us/guide/bgnet/output/ht...age/index.html
Best Regards,
Lars

You guys talk about using transport layer mechanisms (TCP/UDP), but
babakan asked about IP (network layer) datagrams. A far as I know it
is impossible to access IP layer datagrams with socket mechanisms
directly. Not that I know how to do it other way:)
Raw sockets send/recv at the ip layer. You can also use a datalink
socket to read all ip packets of a particular (or all) interfaces.
Linux native sockets api is written in C. There are a lot of C++
adapters out there on the web as earlier posts mentioned. If you are
interested in IP layer packets you need an implementation that
supports raw sockets. If you are using a particular transport layer
(tcp,udp) you'll need to create a raw socket and use the ip_hdrincl,
you will probably have difficulties setting up a tcp socket this way,
unless you have a stack that does the sequencing for you, but for udp
it fairly trivial.
Jan 28 '08 #7
On Jan 28, 12:49 pm, Lars Uffmann <a...@nurfuerspam.dewrote:
szybki wrote:
You guys talk about using transport layer mechanisms (TCP/UDP), but
babakan asked about IP (network layer) datagrams.

Oops, sorry - forgive my ignorance - only just entered the topic this
year - wasn't aware that sockets was limited to the higher layers.
Actually the BSD socket interface allows access to the raw packet
data, allowing arbitrary composing all kind of IP packets.
I even think that posix standardized the API. I'm not sure that there
is any C++ api that allows it. I would bet on ACE though.

HTH,

--
gpd
Jan 28 '08 #8
In article <b4fddfe0-f54c-446e-9c48-2ce07842ce69
@z17g2000hsg.googlegroups.com>, an***************@gmail.com says...

[ ... ]
You guys talk about using transport layer mechanisms (TCP/UDP), but
babakan asked about IP (network layer) datagrams. A far as I know it
is impossible to access IP layer datagrams with socket mechanisms
directly. Not that I know how to do it other way:)
RTFM for SOCK_RAW.

--
Later,
Jerry.

The universe is a figment of its own imagination.
Jan 29 '08 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Dave | last post by:
Hi, This is doubtless a really dumb question but is there an elegant way of reading numbers formatted as hex from a datgram? I get a datgram which contains values like this: ---DATAGRAM---...
0
by: Jonathan Ellis | last post by:
I seem to be running into a limit of 64 queued datagrams. This isn't a data buffer size; varying the size of the datagram makes no difference in the observed queue size. If more datagrams are...
3
by: roberto | last post by:
Hi,i'm trying to read udp packets sent by satellite. It's a porting of a delphi program i did some year ago but , as i'm learning c#, i'd like to do it. I have the ip address of the sat...
4
by: Gregory Hassett | last post by:
Hello, Does anyone know how to get the maximum size of a datagram for a UDP Socket created via .NET's System.Net.Sockets.Socket class? Thanks!
6
by: Iain King | last post by:
Hi. I've been looking everywhere for this and can't find it, apologies if I'm being obtuse: How do I set the max datagram packet size? I'm using the socket module. It seem like it's hardcoded...
4
by: alberto.castellin | last post by:
Hi to all, I've this problem: I create a datagram socket. I create datagram socket with function 'Create'. The line of my code when I create is: m_pSocket->Create(port,SOCK_DGRAM,FD_READ |...
2
by: DaTurk | last post by:
I know in TCP if you send a message down the wire, the OS may lump subsequent messages into a buffer before sending it across the wire, for efficiency. But, will the OS do the same thing with UDP?...
1
by: greenxiar | last post by:
My code is below and the platform is Win2K3 R2: using System; using System.Net; using System.Net.Sockets; using System.Threading; namespace TechUDPBroadcast { class Program { static void...
6
by: 7stud | last post by:
I'm trying to understand datagrams. My client program sends a message to the server, and then the server infinitely loops over the recv() to make sure all the data was received. I'm trying to use...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.