关于简单网络数据包生成器设计和实现的建议 [英] Advice on simple network packet generator design and implementation

查看:130
本文介绍了关于简单网络数据包生成器设计和实现的建议的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是编程新手,所以如果我的问题看起来很明显,请原谅我。我有兴趣学习更多关于网络的知识,尽管我从来没有机会参加课程。有人向我建议,通过编写我自己的程序,使用OSI模型生成简单的数据包,我将学习很多关于数据包和数据包生成的知识,重点关注第2,3和2层。 4,担心只处理以太网,IPv4,IPv6,TCP和UDP等基本重要协议。



我找到了这个方便的参考页面,所以我理解了一下关于不同的层次和他们的目的。我一直在寻找很多来源,如Ostinato,Jperf,JNetPCap等。这些看起来都比我想要完成的要复杂得多。我真的想简单地创建/生成我以前从未见过的数据包。



任何人都可以向我解释这些源代码示例的哪些组件对我有用以我自己的设计和实现为例,看看它是什么样的范围。我以为我可能会用Java编写,因为我对它更熟悉,有大约六个类来完成工作并且只是作为控制台程序运行它。我是不是在这里了?



另外,我是否需要连接到那里的任何库才能生成数据包?我对一些商业数据包生成器中的所有依赖关系感到有些困惑。我一直看到一些对libpcap或winpcap的引用,我不知道这些是否是我需要担心的事情?



只是想找点方向让我开始。谢谢,我真的很感激!



我尝试过:



我一直在谷歌搜索有关如何生成数据包的信息/说明。我发现的大多数信息都是关于接收端或使用嗅探器。也许我正在看的很多内容都是相关的,但我只是没有意识到。



我一直在看这些资源:



参考指南:第1课:开放系统互连(OSI)参考模型 [ ^ ]



Ostinato: http://ostinato.org [ ^ ]



JPerf: github.com/AgilData/jperf/tree/master/src/main/java/org/jperf [ ^ ]



JNetPCap: jnetpcap.com/examples/sendpacket [ ^ ]

I am very new to programming so forgive me if my question may seem obvious. I am interested in learning more about networking, though I never got a chance to take a class in it. It was suggested to me that I will learn a great deal about packets and packet generation by writing my own program to generate simple packets using the OSI model, focusing on layers 2, 3 & 4, and worry about handling only the basic important protocols like Ethernet, IPv4, IPv6, TCP, and UDP.

I found this handy reference page so I understand a bit about the different layers and their purposes. I have been looking at a lot of source such as Ostinato, Jperf, JNetPCap, etc. These all seem quite a bit more complex than what I am trying to accomplish. I really want to simply create/generate the packets which I have never really seen before.

Can anyone explain to me which components of these source examples will be useful for me to look at as examples, and what sort of scope am I looking at with my own design and implementations. I was thinking I would probably write in Java because I am more familiar with it, have about half dozen classes to complete the work and just run it as a console program. Am I off the mark here?

Also, will I need to connect to any libraries out there just to do the generating of packets? I was a bit confused about all the dependencies in some of the commercial packet generators. I keep seeing some references to libpcap, or winpcap and I don't know if these are things I need to worry about?

Just looking for some direction to get me started. Thanks, I really appreciate it!

What I have tried:

I have been google searching for information/instructions on how to generate packets. Most information I've found is about the receiving end, or using a sniffer. Maybe much of what I'm looking at is relevant, but I just don't realize it.

I have been looking at these resources:

Reference guide: Lesson 1: Open Systems Interconnection (OSI) Reference Model[^]

Ostinato: http://ostinato.org[^]

JPerf: github.com/AgilData/jperf/tree/master/src/main/java/org/jperf[^]

JNetPCap: jnetpcap.com/examples/sendpacket[^]

推荐答案

Java不是这类应用程序的最佳语言选择,您可以更好地学习C或C ++。您还需要全面了解计划使用的操作系统中可用的API。
Java is not the best language choice for this type of application, you would be better studying C or C++. You also need a thorough understanding of the API available within the OS that you plan to work with.


虽然通过生成自己的数据包来了解网络是很好的,但您不需要写一个程序来做到这一点。我的建议是使用Ostinato生成数据包 - 在Ostinato中作为用户生成数据包的过程很低,足以让您了解网络数据包,层,标题和字段。



同时查看Wireshark中的数据包捕获也是值得的。



理想情况下,你应该有一个具备网络知识的人才能回答问题你总会有 - 一本书很好,但不足以回答问题:-)



如果你还想编写自己的程序,请使用libpcap (或Windows上的WinPCAP) - 从这个发送数据包教程开始



祝你好运!



披露:我是Ostinato的开发者
While it is good to understand networking by generating your own packets, you don't need to write a program to do that. My advice is to generate packets using Ostinato - the process of generating packets as a user in Ostinato is low level enough for you to understanding the networking packets, layers, headers and fields.

It would also be worthwhile to look at packet captures in Wireshark at the same time.

Ideally you should have someone with networking knowledge to be able to answer questions that you will invariably have - a book is good, but not good enough to answer questions :-)

If you would still like to write your own program, use libpcap (or WinPCAP on Windows) - start with this Sending Packets Tutorial

Good luck!

Disclosure: I'm the developer of Ostinato


这篇关于关于简单网络数据包生成器设计和实现的建议的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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