首页 \ 问答 \ BACnet虚拟设备 - 永远不会响应直接命令(BACnet Virtual Devices - never respond to a direct command)

BACnet虚拟设备 - 永远不会响应直接命令(BACnet Virtual Devices - never respond to a direct command)

一些背景:我正在尝试创建一个虚拟BACnet路由器,后面有虚拟设备( 参见相关文章 )。 我的测试环境由运行在我的服务器上的VM(10.2.0.15)组成,BACnet浏览器和Wireshark在其上运行。 我正在VS2013中编写代码,并在本地计算机上运行wireshark(192.168.56.1)。

当我启动虚拟路由器并从虚拟机发送who-is广播时,我看到在vm上运行的wireshark上的命令和响应。 在我的本地机器上,我只能看到wireshark中的命令,但没有响应。

所有这些工作正常。 但是,I-am响应的源地址(根据虚拟机上的wireshark以及BACnet资源管理器详细信息)是虚拟机和我的计算机之间的网关(10.2.0.2)的源地址。

问题后续的谁是针对特定虚拟设备的命令永远不会访问我的本地计算机。 我可以看到在vm上使用wireshark创建的命令,但是我的代码从未看到请求,我的本地计算机上的wireshark也看不到新数据包。

问题初始i-am响应的源地址应该是本地机器的IP地址还是我分配给虚拟设备的IP地址? 如上所述,源地址当前是VM和我的机器之间的网关的地址。

以下是我用来构建对who-is命令的响应的NPDU部分的代码 - 希望有人能够指出我做错了什么。

        bytes[pos++] = BACnetEnums.BACNET_PROTOCOL_VERSION;

        //Control byte determines what fields exist in the rest of the NPDU record
        bytes[pos++] = this.AssembleControl();  //in the case, the response is 0x28

        //Destination Network Info
        //65535 - Broadcast
        bytes[pos++] = 0xff;  //DNET
        bytes[pos++] = 0xff;  //DNET

        //Destination 
        bytes[pos++] = 0x00;  //DLEN
                              //DADDR
        //none since len = 0 and this is being broadcasted back

        bytes[pos++] = 0x00;  //SNET
        bytes[pos++] = 0x00;  //SNET

        bytes[pos++] = 0x06;  //SLEN

        //address should be 10.1.0.xxx, where x is the deviceid
        bytes[pos++] = this.SADR[0];  //10
        bytes[pos++] = this.SADR[1];  //1
        bytes[pos++] = this.SADR[2];  //0
        bytes[pos++] = this.SADR[3];  //varies based on the ID of the device - pulled from database
        bytes[pos++] = 0xBA;
        bytes[pos++] = 0xC0;

        //HopCount
        bytes[pos++] = 0xff;

Some background: I'm attempting to create a virtual BACnet router with virtual devices behind it (see related post). My test environment consists of a VM ( 10.2.0.15 ) running on my server with a BACnet explorer and Wireshark running on it. I'm writing the code in VS2013 and also running wireshark on my local machine ( 192.168.56.1 ).

When I start the virtual router and send a who-is broadcast from the VM, I see the command and responses on the wireshark running on the vm. On my local machine, I only see the command in wireshark, but not the responses going out.

All of this works fine. However, the source address of the i-am responses ( according to wireshark on the VM as well as in the BACnet explorer details ) is that of the gateway (10.2.0.2) between the VM and my machine.

The Problem Subsequent who-is commands targeting a specific virtual device never get to my local machine. I can see the command being created using wireshark on the vm, but my code never sees the request nor does wireshark on my local machine see a new packet.

The Question Should the source address of the initial i-am responses be the IP of my local machine or the IP address that I've assigned to the virtual device? As stated above, the source address is currently that of the gateway between the VM and my machine.

Here is the code I'm using to construct the NPDU portion of the response to a who-is command - Hopefully someone can point out what I'm doing incorrectly.

        bytes[pos++] = BACnetEnums.BACNET_PROTOCOL_VERSION;

        //Control byte determines what fields exist in the rest of the NPDU record
        bytes[pos++] = this.AssembleControl();  //in the case, the response is 0x28

        //Destination Network Info
        //65535 - Broadcast
        bytes[pos++] = 0xff;  //DNET
        bytes[pos++] = 0xff;  //DNET

        //Destination 
        bytes[pos++] = 0x00;  //DLEN
                              //DADDR
        //none since len = 0 and this is being broadcasted back

        bytes[pos++] = 0x00;  //SNET
        bytes[pos++] = 0x00;  //SNET

        bytes[pos++] = 0x06;  //SLEN

        //address should be 10.1.0.xxx, where x is the deviceid
        bytes[pos++] = this.SADR[0];  //10
        bytes[pos++] = this.SADR[1];  //1
        bytes[pos++] = this.SADR[2];  //0
        bytes[pos++] = this.SADR[3];  //varies based on the ID of the device - pulled from database
        bytes[pos++] = 0xBA;
        bytes[pos++] = 0xC0;

        //HopCount
        bytes[pos++] = 0xff;

原文:https://stackoverflow.com/questions/34746404
更新时间:2023-11-02 14:11

最满意答案

使用PDF规范中的标准加密算法无法完成您想要做的事情。

PDF允许使用RC4或AES两种算法之一加密文档。 两种算法都是对称密钥算法 ,这意味着它们使用相同的密钥来加密和解密数据。 为了具有“不区分大小写”,您需要有几个可以解密相同数据的密钥,这两个算法都不允许这样的事情。


What you want to do cannot be done by using standard encryption algorithms from the PDF specification.

PDF allows encrypting the document using one of two algorithms, RC4 or AES. Both algorithms are symetric-key algorithms, meaning that they use the same key for encrypting and decrypting the data. In order to have "case insensivity", you would need to have several possible keys that can decrypt the same data, none of these two algorithms allow such thing.

相关问答

更多

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)