隨著網路的發展,傳統網路面臨到了許多困難,而網路功能虛擬化(Network Function Virtualization, NFV) 技術由於軟體定義網路(Software Defined Networking, SDN) 的發展而被提出,透過虛擬化技術將網路功能與底層硬體分離,讓網路服務能夠動態的配置,並且節省成本。藉由NFV技術,網路功能鏈(Service Function Chaining, SFC) 也隨之而生,讓原先傳統網路的實體接線也能夠虛擬化,使得原先端點到端點的訊務依照特定的服務順序繞送後再送至目的地。而網路服務的配置位置會影響服務的品質,例如運算資源或者訊務負載。本論文嘗試設計SDN環境上的SFC部署策略,優化網路服務配置及服務效能。 本論文提出GASFC配置法基於基因演算法(Genetic Algorithm, GA),透過高效的演算法能夠快速在複雜的拓樸中分配網路服務,並且能夠動態的根據不同的SFC路經直接運算出符合資源配置以及最佳化鏈路訊務負載,減少資料中心的計算資源的消耗以及提升網路的訊務負載承受量。 本論文建置P4網路,提出P4NSH架構,藉由P4的軟體交換器BMv2實作SDN網路,並且利用P4實作Classifier、Forwarder等功能,引入Network Service Header (NSH) 封裝來加強SFC網路訊務的功能,透過優化NSH Forward 機制來減少交換器所需要的Entry數量,並且設計一Proxy來相容所有傳統的網路服務,使得傳統資料中心在引入SDN及SFC上有更少的技術阻礙。;The network technology changed rapidly. Traditional networking faces many difficulties. The Network Function Virtualization (NFV) is introduced because of the Software Defined Networking (SDN). The SDN separates the control plane and data plane on networking. The NFV separates network functions from the underlying hardware to configure the services dynamically and save cost. With the NFV technology, the Service Function Chaining (SFC) architecture is proposed to virtualize the physical connections, which allow traffic route to some service functions between end-to-end services. The placement of the network services affects the quality of service like computing resource and traffic loading. We design a service function deployment policy of SFC on SDN environment to optimize the placement of service functions and performance of services. We proposed the GASFC, a high performance based on Genetic Algorithm (GA) to deploy service functions quickly in a complexity network environment. GASFC takes SFC configurations into account in real time. This algorithm decreases the consumption of the computing resource and increases the capacity of the traffic in the data center. We also proposed the P4NSH architecture. Using the P4 software switch(BMv2) to build an SDN environment and design SFC functions like Classifier, Forwarder, etc. We also adopt the Network Service Header (NSH) to strengthen the functions of SFC and optimize the forwarding policy to decrease the usage of switch table entries. We design an NSH proxy to be compatible with traditional network services and make the traditional data center have fewer technical obstacles in introducing SDN and SFC.