現(xiàn)在neutron支持創(chuàng)建不同的網(wǎng)絡(luò)指定不同的mtu,這個(gè)應(yīng)用場景主要是vlan和vxlan混用的情況下。
創(chuàng)新互聯(lián)服務(wù)項(xiàng)目包括鐘山網(wǎng)站建設(shè)、鐘山網(wǎng)站制作、鐘山網(wǎng)頁制作以及鐘山網(wǎng)絡(luò)營銷策劃等。多年來,我們專注于互聯(lián)網(wǎng)行業(yè),利用自身積累的技術(shù)優(yōu)勢、行業(yè)經(jīng)驗(yàn)、深度合作伙伴關(guān)系等,向廣大中小型企業(yè)、政府機(jī)構(gòu)等提供互聯(lián)網(wǎng)行業(yè)的解決方案,鐘山網(wǎng)站推廣取得了明顯的社會(huì)效益與經(jīng)濟(jì)效益。目前,我們服務(wù)的客戶以成都為中心已經(jīng)輻射到鐘山省份的部分城市,未來相信會(huì)繼續(xù)擴(kuò)大服務(wù)區(qū)域并繼續(xù)獲得客戶的支持與信任!具體配置
1、neutron.conf network_device_mtu=1450 # 生效的設(shè)備:neutron 網(wǎng)絡(luò)節(jié)點(diǎn)上的 qdhcp 和 qrouter network namespace 的 qr,qg 和 ns 接口以及對應(yīng)的 veth tap 設(shè)備 /usr/lib/python2.7/site-packages/neutron/agent/linux/interface.py if self.conf.network_device_mtu: ns_dev.link.set_mtu(self.conf.network_device_mtu) if self.conf.ovs_use_veth: root_dev.link.set_mtu(self.conf.network_device_mtu)
2、ml2_conf.ini path_mtu = 9000 segment_mtu = 1500
flat網(wǎng)絡(luò)類型如何獲取MTU: /usr/lib/python2.7/site-packages/neutron/plugins/ml2/drivers/type_flat.py class FlatTypeDriver(helpers.BaseTypeDriver): # 父類BaseTypeDriver """Manage state for flat networks with ML2. The FlatTypeDriver implements the 'flat' network_type. Flat network segments provide connectivity between VMs and other devices using any connected IEEE 802.1D conformant physical_network, without the use of VLAN tags, tunneling, or other segmentation mechanisms. Therefore at most one flat network segment can exist on each available physical_network. """ def __init__(self): super(FlatTypeDriver, self).__init__() self._parse_networks(cfg.CONF.ml2_type_flat.flat_networks) # 如果定義了flat provider的physet_mtus,取physical_network_mtus和segment_mtu的最小值 def get_mtu(self, physical_network): seg_mtu = super(FlatTypeDriver, self).get_mtu() mtu = [] if seg_mtu > 0: mtu.append(seg_mtu) if physical_network in self.physnet_mtus: mtu.append(int(self.physnet_mtus[physical_network])) return min(mtu) if mtu else 0 /usr/lib/python2.7/site-packages/neutron/plugins/ml2/drivers/helpers.py class BaseTypeDriver(api.TypeDriver): """BaseTypeDriver for functions common to Segment and flat.""" def __init__(self): try: self.physnet_mtus = utils.parse_mappings( cfg.CONF.ml2.physical_network_mtus ) except Exception: self.physnet_mtus = [] def get_mtu(self, physical_network=None): return cfg.CONF.ml2.segment_mtu
vlan網(wǎng)絡(luò)類型如何獲取MTU: class VlanTypeDriver(helpers.SegmentTypeDriver): # 父類SegmentTypeDriver """Manage state for VLAN networks with ML2. The VlanTypeDriver implements the 'vlan' network_type. VLAN network segments provide connectivity between VMs and other devices using any connected IEEE 802.1Q conformant physical_network segmented into virtual networks via IEEE 802.1Q headers. Up to 4094 VLAN network segments can exist on each available physical_network. """ def __init__(self): super(VlanTypeDriver, self).__init__(VlanAllocation) self._parse_network_vlan_ranges() # vlan的獲取mtu方式和flat一樣 def get_mtu(self, physical_network): seg_mtu = super(VlanTypeDriver, self).get_mtu() mtu = [] if seg_mtu > 0: mtu.append(seg_mtu) if physical_network in self.physnet_mtus: mtu.append(int(self.physnet_mtus[physical_network])) return min(mtu) if mtu else 0 /usr/lib/python2.7/site-packages/neutron/plugins/ml2/drivers/helpers.py class BaseTypeDriver(api.TypeDriver): """BaseTypeDriver for functions common to Segment and flat.""" def __init__(self): try: self.physnet_mtus = utils.parse_mappings( cfg.CONF.ml2.physical_network_mtus ) except Exception: self.physnet_mtus = [] def get_mtu(self, physical_network=None): return cfg.CONF.ml2.segment_mtu class SegmentTypeDriver(BaseTypeDriver): """SegmentTypeDriver for segment allocation. Provide methods helping to perform segment allocation fully or partially specified. """ def __init__(self, model): super(SegmentTypeDriver, self).__init__() self.model = model self.primary_keys = set(dict(model.__table__.columns)) self.primary_keys.remove("allocated")
vxlan網(wǎng)絡(luò)類型如何獲取MTU: class VxlanTypeDriver(type_tunnel.EndpointTunnelTypeDriver): # 父類EndpointTunnelTypeDriver def __init__(self): super(VxlanTypeDriver, self).__init__( VxlanAllocation, VxlanEndpoints) def get_type(self): return p_const.TYPE_VXLAN def initialize(self): try: self._initialize(cfg.CONF.ml2_type_vxlan.vni_ranges) except n_exc.NetworkTunnelRangeError: LOG.exception(_LE("Failed to parse vni_ranges. " "Service terminated!")) raise SystemExit() def get_endpoints(self): """Get every vxlan endpoints from database.""" vxlan_endpoints = self._get_endpoints() return [{'ip_address': vxlan_endpoint.ip_address, 'udp_port': vxlan_endpoint.udp_port, 'host': vxlan_endpoint.host} for vxlan_endpoint in vxlan_endpoints] def add_endpoint(self, ip, host, udp_port=p_const.VXLAN_UDP_PORT): return self._add_endpoint(ip, host, udp_port=udp_port) def get_mtu(self, physical_network=None): mtu = super(VxlanTypeDriver, self).get_mtu() return mtu - p_const.VXLAN_ENCAP_OVERHEAD if mtu else 0 # mtu - vxlan開銷,自動(dòng)減去vxlan overhead from neutron.plugins.common import constants as p_const /usr/lib/python2.7/site-packages/neutron/plugins/common/constants.py # Network Type MTU overhead GENEVE_ENCAP_MIN_OVERHEAD = 50 GRE_ENCAP_OVERHEAD = 42 VXLAN_ENCAP_OVERHEAD = 50 # vxlan開銷 class EndpointTunnelTypeDriver(TunnelTypeDriver): class TunnelTypeDriver(helpers.SegmentTypeDriver): """Define stable abstract interface for ML2 type drivers. tunnel type networks rely on tunnel endpoints. This class defines abstract methods to manage these endpoints. """ def get_mtu(self, physical_network=None): seg_mtu = super(TunnelTypeDriver, self).get_mtu() mtu = [] if seg_mtu > 0: mtu.append(seg_mtu) if cfg.CONF.ml2.path_mtu > 0: mtu.append(cfg.CONF.ml2.path_mtu) return min(mtu) if mtu else 0
gre網(wǎng)絡(luò)類型如何獲取MTU: class GreTypeDriver(type_tunnel.EndpointTunnelTypeDriver): # 父類也是EndpointTunnelTypeDriver def __init__(self): super(GreTypeDriver, self).__init__( GreAllocation, GreEndpoints) def get_type(self): return p_const.TYPE_GRE def initialize(self): try: self._initialize(cfg.CONF.ml2_type_gre.tunnel_id_ranges) except n_exc.NetworkTunnelRangeError: LOG.exception(_LE("Failed to parse tunnel_id_ranges. " "Service terminated!")) raise SystemExit() def get_endpoints(self): """Get every gre endpoints from database.""" gre_endpoints = self._get_endpoints() return [{'ip_address': gre_endpoint.ip_address, 'host': gre_endpoint.host} for gre_endpoint in gre_endpoints] def add_endpoint(self, ip, host): return self._add_endpoint(ip, host) def get_mtu(self, physical_network=None): mtu = super(GreTypeDriver, self).get_mtu(physical_network) return mtu - p_const.GRE_ENCAP_OVERHEAD if mtu else 0 # mtu - gre開銷,自動(dòng)減去gre overhead from neutron.plugins.common import constants as p_const /usr/lib/python2.7/site-packages/neutron/plugins/common/constants.py # Network Type MTU overhead GENEVE_ENCAP_MIN_OVERHEAD = 50 GRE_ENCAP_OVERHEAD = 42 # gre開銷,為什么是42,還不清楚 VXLAN_ENCAP_OVERHEAD = 50 # vxlan開銷 L版發(fā)現(xiàn)neutron多了種網(wǎng)絡(luò)類型geneve,Geneve簡介,暫時(shí)還不知道怎么玩的 http://blog.csdn.net/yeasy/article/details/39928153
3、neutron.conf advertise_mtu = true 以前的做法: [root@controller2 ~(keystone_admin)]# cat /etc/neutron/dnsmasq-neutron.conf # 對所有network都生效 dhcp-option-force=26,1450 # 現(xiàn)在可以把這個(gè)去掉 log-facility=/var/log/neutron/neutron-dnsmasq.log /usr/lib/python2.7/site-packages/neutron/agent/linux/dhcp.py class Dnsmasq(DhcpLocalProcess): # The ports that need to be opened when security policies are active # on the Neutron port used for DHCP. These are provided as a convenience # for users of this class. if cfg.CONF.advertise_mtu: mtu = self.network.mtu # Do not advertise unknown mtu if mtu > 0: cmd.append('--dhcp-option-force=option:mtu,%d' % mtu) # 看這里 # Cap the limit because creating lots of subnets can inflate # this possible lease cap. cmd.append('--dhcp-lease-max=%d' % min(possible_leases, self.conf.dnsmasq_lease_max)) cmd.append('--conf-file=%s' % self.conf.dnsmasq_config_file) if self.conf.dnsmasq_dns_servers: cmd.extend( '--server=%s' % server for server in self.conf.dnsmasq_dns_servers)
參考鏈接
http://www.cnblogs.com/sammyliu/p/5079898.html
另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)scvps.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場景需求。
當(dāng)前標(biāo)題:Neutron-Automaticnetworkmtu-創(chuàng)新互聯(lián)
網(wǎng)頁路徑:http://jinyejixie.com/article4/cesioe.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站改版、網(wǎng)站排名、做網(wǎng)站、網(wǎng)站策劃、品牌網(wǎng)站設(shè)計(jì)、網(wǎng)站收錄
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容