arp

计算机网络补充习题

你说的曾经没有我的故事 提交于 2019-12-21 06:21:29
简述PPP协议中口令鉴别协议PAP和挑战握手鉴别协议CHAP协议的工作过程,可以用流程图表示 答: PAP(Password Authentication Protocol,口令鉴定协议)是一种两次握手验证协议,它在网络上采用明文方式传输用户名和口令。PAP验证的过程如下: 被验证方主动发起验证请求,将本端的用户名和口令发送到验证方; 验证方接到被验证方的验证请求后,检查此用户名是否存在以及口令是否正确。 如果此用户名存在且口令正确,验证方返回Acknowledge响应,表示验证通过; 如果此用户名不存在或口令错误。验证方返回Not Acknowledge响应,表示验证不通过。 PAP: CHAP(Challenge Handshake Authentication Protocol,质询握手鉴定协议)是一种三次握手验证协议,它只在网络上传输用户名,而用户口令并不在网络上传播。CHAP验证过程如下: 验证方主动发起验证请求,向被验证方发送一些随机产生的报文,并同时将本端配置的用户名附带上一起发送给被验证方; 被验证方接到验证方的验证请求后,根据此报文中的用户名在本端的用户表中查找用户口令。 如找到用户表中与验证方用户名相同的用户,便利用报文ID和此用户的口令以MD5算法生成应答,随后将应答和自己的用户名送回; 验证方接收到此应答后,利用报文ID

Resolving MAC address for IP address using C++ on Linux

浪子不回头ぞ 提交于 2019-12-21 05:11:18
问题 I need to generate an Ethernet header that includes the destination MAC address, (since libnfnetlink gives only the IP header before prerouting takes place), the outgoing interface number is also known, so the lookup can be made in the correct network. What's the library/function to resolve the MAC address from an IP address? 回答1: It's unclear why you need the MAC address, since that's usually handled for you at a lower level. However, assuming your target is on your local Ethernet segment,

LVS负载均衡

与世无争的帅哥 提交于 2019-12-21 03:18:15
一、负载均衡LVS基本介绍 ●LB集群的架构和原理很简单,就是当用户的请求过来时,会直接分发到Director Server上,然后它把用户的请求根据设置好的调度算法,智能均衡地分发到后端真正服务器(real server)上。为了避免不同机器上用户请求得到的数据不一样,需要用到了共享存储,这样保证所有用户请求的数据是一样的。 ●LVS是 Linux Virtual Server 的简称,也就是Linux虚拟服务器。这是一个由章文嵩博士发起的一个开源项目,它的官方网站是 http://www.linuxvirtualserver.org 现在 LVS 已经是 Linux 内核标准的一部分。 ●使用 LVS 可以达到的技术目标是:通过 LVS 达到的负载均衡技术和 Linux 操作系统实现一个高性能高可用的 Linux 服务器集群,它具有良好的可靠性、可扩展性和可操作性。从而以低廉的成本实现最优的性能。LVS 是一个实现负载均衡集群的开源软件项目,LVS架构从逻辑上可分为调度层、Server集群层和共享存储。 二、LVS的基本工作原理 1、当用户向负载均衡调度器(Director Server)发起请求,调度器将请求发往至内核空间 2、PREROUTING链首先会接收到用户请求,判断目标IP确定是本机IP,将数据包发往INPUT链 3、IPVS是工作在INPUT链上的

LVS负载均衡群集(理论)

懵懂的女人 提交于 2019-12-20 20:38:56
群集的含义 Cluster,集群,群集 由多台主机构成,但对外只表现为一个整体 在互联网应用中,随着站点对硬件性能,相应速度,服务稳定性,数据可靠性等要求越来越高,单台服务器力不从心 解决方法: 使用价格昂贵的小型机,大型机 使用普通服务器构建服务群集 企业群集分类 根据群集所针对的目标差异,可分为三种类型 负载均衡群集 高可用群集 高性能运算群集 负载均衡群集  以提高应用系统的响应能力,尽可能处理更多的访问请求,减少延迟为目标,获得高并发,高负载LB)的整体性能  LB的负载分配依赖于主节点的分流算法 高可用群集  以提高应用系统的可靠性,尽可能的减少中断时间为目标,确保服务的连续性,达到高可用(HA)的容错效果  HA的工作方式包括双工和主从两种模式 高性能运算群集  以提高应用系统的CPU运算速度,扩展资源和分析能力为目标,获得相当于大型,超级计算机的高性能运算(HPC)能力  高性能运算群集的高性能依赖于“分布式运算”,“并行计算”,通过专用硬件和软件将多个服务器的CPU,内存等资源整合在一起,实现只有大型,超级计算机才具备的计算能力 负载均衡群集工作模式分析 负载均衡群集是目前企业用的最多的群集类型 群集的负载调度技术有三种工作模式: 地址转换 IP隧道 直接路由 NAT模式 TUN模式 DR模式 负载均衡群集结构 负载均衡的结构: 第一层,负载调度器 第二层,服务器池

LVS负载均衡群集——keepalived+DR模式(实战!)

余生长醉 提交于 2019-12-20 20:25:11
keepalived实现原理 keepalived采用vrrp热备份协议,实现Linux服务器的多机热备功能 vrrp,虚拟路由冗余协议,是针对路由器的一种备份解决方案 keepalivd案列讲解 keepalived可实现多机热备,每个热备组有多台服务器,最常用的就是双机热备 双机热备的故障切换是由虚拟IP地址的漂移来实现,适用于各种应用服务器 DR模式原理 实验环境 CentOS7系统: DR1 主: 192.168.100.2 DR2 备: 192.168.100.20 虚拟IP:192.168.100.10 web1:192.168.100.221 web2:192.168.100.222 win10系统: client:192.168.100.100 1、分别在四台Linux虚拟机上安装实验所需软件包 DR1主: [root@localhost ~]# yum install ipvsadm keepalived -y DR2从: [root@localhost ~]# yum install ipvsadm keepalived -y web1: [root@localhost ~]# yum install httpd -y web2: [root@localhost ~]# yum install httpd -y 2、分别将五台虚拟机的网络模式改为仅主机模式

ARP Timeouts. Why fixed periodic?

久未见 提交于 2019-12-20 14:41:07
问题 This one's been bugging me for years. Basic question: Is there some reason ARP has to be implemented with fixed timeouts on ARP cache entries? I do a lot of work in Real Time ciricles. We do most of our inter-system communications these days on dedicated UDP/IP links. This for the most part works reliably in Real Time, but for one nit: ARP entry timeouts. The way typical implementations do ARP is the following: When client asks to send an IP packet to an IP address with an unkown MAC address,

Python arp sniffing raw socket no reply packets

廉价感情. 提交于 2019-12-20 09:23:40
问题 to understand the network concepts a bit better and to improve my python skills I am trying to implement a packet sniffer with python. I have just started to learn python, so the code could be optimized of course ;) I have implemented an packet sniffer which unpacks the ethernet frame and the arp header. I want to make it with raw sockets because I want to understand every byte within those headers, so please no scapy help :) The problem is, that I won´t get any arp reply packet. It´s always

How to get the IP address of a remote host from its Ethernet address?

◇◆丶佛笑我妖孽 提交于 2019-12-20 01:58:18
问题 I'm looking for some Linux code to find an IP address from an Ethernet address. I suppose I have to do some inverse ARP trickery but I don't find any example... 回答1: http://compnetworking.about.com/od/networkprotocolsip/f/convertipmacadd.htm Try sending an IP broadcast (e.g. ping 192.168.1.255 if your subnet is 192.168.1.0/24) to prime your ARP cache, followed by arp -a to spit it all out. 回答2: For computers that you have communicated with, you can look at their arp entry. This is available

MAC地址的作用

醉酒当歌 提交于 2019-12-19 13:49:25
MAC地址也叫物理地址、硬件地址或链路地址,由网络设备制造商生产时写在硬件内部。IP地址与MAC地址在计算机里都是以二进制表示的,IP地址是32 位的,而MAC地址则是48位的。MAC地址的长度为48位(6个字节),通常表示为12个16进制数,每2个16进制数之间用冒号隔开,如:08: 00:20:0A:8C:6D就是一个MAC地址,其中前6位16进制数08:00:20代表网络硬件制造商的编号,它由IEEE(电气与电子工程师协 会)分配,而后3位16进制数0A:8C:6D代表该制造商所制造的某个网络产品(如网卡)的系列号。只要你不去更改自己的MAC地址,那么你的MAC地 址在世界是惟一的。 MAC地址的作用 IP地址就如同一个职位,而MAC地址则好像是去应聘这个职位的人才,职位可以既可以让甲坐,也可以让乙坐,同样的道理一个节点的IP地址对于网卡是不做 要求,基本上什么样的厂家都可以用,也就是说IP地址与MAC地址并不存在着绑定关系。本身有的计算机流动性就比较强,正如同人才可以给不同的单位干活的 道理一样的,人才的流动性是比较强的。职位和人才的对应关系就有点像是IP地址与MAC地址的对应关系。比如,如果一个网卡坏了,可以被更换,而无须取得 一个新的IP地址。如果一个IP主机从一个网络移到另一个网络,可以给它一个新的IP地址,而无须换一个新的网卡。当然MAC地址除了仅仅只有这个功能还

C++ variable length arrays in struct

◇◆丶佛笑我妖孽 提交于 2019-12-19 03:22:36
问题 I am writing a program for creating, sending, receiving and interpreting ARP packets. I have a structure representing the ARP header like this: struct ArpHeader { unsigned short hardwareType; unsigned short protocolType; unsigned char hardwareAddressLength; unsigned char protocolAddressLength; unsigned short operationCode; unsigned char senderHardwareAddress[6]; unsigned char senderProtocolAddress[4]; unsigned char targetHardwareAddress[6]; unsigned char targetProtocolAddress[4]; }; This only