访问原始TCP数据包有效负载数据 [英] Accessing raw TCP packet payload data

查看:63
本文介绍了访问原始TCP数据包有效负载数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


有没有人知道是否可以使用.NET(C#)从

a TCP数据包中获取原始有效负载数据确切地说。


我正在编写一个软件,它使用封装在TCP内部的协议与网络的
设备进行通信。协议的结构是这样的,流语义并不真正适合通信; b $ b用于通信;封装数据包的所有数据必须在单个TCP数据包中适合
。我只是希望能够从设备中获取每个TCP数据包的有效负载,

已建立的连接。


-

Chris Crowther

开发商

J& M Crowther Ltd.

Hi All,

Does anyone know if it''s possible to grab the raw payload data from
a TCP packet, using .NET (C# to be exact).

I''m writing a piece of software that communicates to a networked
device using a protocol encapsulated inside TCP. The structure of
the protocol is such that stream semantics aren''t really appropiate
for communication; all the data for an encapsulated packet has to
fit inside a single TCP packet. I just want to be able to pickup
the payload for each TCP packet that comes in from the device, on
the established connection.

--
Chris Crowther
Developer
J&M Crowther Ltd.

推荐答案

看看这篇文章:

http://www.c-sharpcorner.com/Network...fferInCSLM.asp


-

HTH,


Kevin Spencer

微软MVP

专业鸡肉沙拉炼金术士


大厚片由许多小薄片组成。

Chris Crowther <喜**** @ newsgroups.nospam>在消息中写道

新闻:OV ************** @ TK2MSFTNGP02.phx.gbl ...
Check out this article:

http://www.c-sharpcorner.com/Network...fferInCSLM.asp

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Chicken Salad Alchemist

Big thicks are made up of lots of little thins.
"Chris Crowther" <hi****@newsgroups.nospam> wrote in message
news:OV**************@TK2MSFTNGP02.phx.gbl...
大家好,

有没有人知道是否可以使用.NET(确切地说是C#)从TCP数据包中获取原始有效负载数据。

我'我正在编写一个软件,使用封装在TCP内部的协议与网络设备进行通信。协议的结构使得流语义不适合于通信;封装数据包的所有数据必须适合单个TCP数据包。我只是希望能够为已经建立的连接上的设备中的每个TCP数据包提取有效负载。

-
Chris Crowther
开发人员
J& M Crowther有限公司
Hi All,

Does anyone know if it''s possible to grab the raw payload data from
a TCP packet, using .NET (C# to be exact).

I''m writing a piece of software that communicates to a networked
device using a protocol encapsulated inside TCP. The structure of
the protocol is such that stream semantics aren''t really appropiate
for communication; all the data for an encapsulated packet has to
fit inside a single TCP packet. I just want to be able to pickup
the payload for each TCP packet that comes in from the device, on
the established connection.

--
Chris Crowther
Developer
J&M Crowther Ltd.



如前所述,您可以使用原始套接字等来访问此

信息。然而,我不得不怀疑在这样一个

场景中使用TCP的意义。

" Chris Crowther" < hi **** @ newsgroups.nospamwrote in message

news:OV ************** @ TK2MSFTNGP02.phx.gbl ...
As has already been mentioned you can use raw sockets etc to access this
information. I would however have to wonder the point of using TCP in such a
scenario.
"Chris Crowther" <hi****@newsgroups.nospamwrote in message
news:OV**************@TK2MSFTNGP02.phx.gbl...

大家好,


有谁知道是否可以从
$ b获取原始有效载荷数据$ ba TCP数据包,使用.NET(确切地说是C#)。


我正在写一个软件,它与网络的

设备进行通信使用封装在TCP内部的协议。协议的结构是这样的,流语义并不真正适合通信; b $ b用于通信;封装数据包的所有数据必须在单个TCP数据包中适合
。我只是希望能够从设备中获取每个TCP数据包的有效负载,

已建立的连接。


-

Chris Crowther

开发商

J& M Crowther Ltd.
Hi All,

Does anyone know if it''s possible to grab the raw payload data from
a TCP packet, using .NET (C# to be exact).

I''m writing a piece of software that communicates to a networked
device using a protocol encapsulated inside TCP. The structure of
the protocol is such that stream semantics aren''t really appropiate
for communication; all the data for an encapsulated packet has to
fit inside a single TCP packet. I just want to be able to pickup
the payload for each TCP packet that comes in from the device, on
the established connection.

--
Chris Crowther
Developer
J&M Crowther Ltd.


Greg Young写道:
Greg Young wrote:

如前所述,你可以使用原始套接字等来访问这个

信息。然而,我不得不怀疑在这样一个

场景中使用TCP的重点。
As has already been mentioned you can use raw sockets etc to access this
information. I would however have to wonder the point of using TCP in such a
scenario.



鉴于我必须自己重新实现TCP的机制,那么

并不是很重要。如果我可以拿起有效载荷那么

它可能会稍微容错一些而不需要

我的任何额外工作。


我也可以只使用协议的UDP版本 - 无论如何在封装协议中进行
会话注册。

实际上有'封装的

协议中的会话注册以及封装封装的协议。


-

Chris Crowther
开发商

J& M Crowther Ltd.

Given I''d have to re-implement the mechanics of TCP myself, there
isn''t much point at all. If I could just pick up the payloads then
it would have been slightly more error tolerant without requiring
any extra work on my part.

I may as well just use the UDP version of the protocol - there''s
session registration within the encapsulated protocol anyway.
Actually there''s session registration within the encapsulated
protocol and the protocol that the encapsulation is encapsulating.

--
Chris Crowther
Developer
J&M Crowther Ltd.


这篇关于访问原始TCP数据包有效负载数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆